SlideShare a Scribd company logo
1 of 32
Download to read offline
Software Engineering



  ●Testing
   ●Unit-testing

    ●JUnit
Why testing at all?
Simplest case:
      Development => Production
700




600




500



       (random numbers, but you get the idea)
400



                                                    Bugs found
300
                                                    Bugfix Cost

200




100




  0


       Development                        Release
Real world
                 (no testing)
1600
                        € 1,500.00
1400




1200




1000




 800
                                     Bugs found
                                     Cost per Bug
       435
 600




 400                  321
 200
           € 200.00
   0


       Development    Production
Real world
                     (no testing)
1600
           321 x 1500 =     € 1,500.00   Total:
1400        €481,500                     € 568,500
1200




       435 x 200 =
1000




 800    €87,000                          Bugs found
                                         Cost per Bug
       435
 600




 400                      321
 200
           € 200.00
   0


       Development        Production
Real world
                      + testing
          121 x 1500 =
1600

           €181,500        € 1,500.00   Total:
1400
                                        € 308,500
1200


         635 x 200 =
          €127,000
1000




       635
 800
                                        Bugs found
 600
                                        Cost per Bug

 400


           € 200.00
 200                     121
   0


       Development       Production
no testing vs + testing
600000
         € 568,500.00
500000
                        about a half!
400000



                           € 308,500.00
300000

                                          Cost


200000




100000




     0


          No testing       With testing
In the software eng. process...

Imagination            Real world



 Design                 Coding
In the software eng. process...

Imagination            Real world


              GAP
 Design        `        Coding
In the software eng. process...

Imagination             Real world



 Design       Testing    Coding
Continue with examples

   A living cell:
    A quick introduction to JUnit, D. Steinberg
    http://www.slideshare.net/sundar22in/junit



   Shopping Cart
    Unit testing with JUnit, T. Zimmermann
    http://www.slideshare.net/tom.zimmermann/unit-testing-with-junit
Let's try it out!
Create a new Java Project
Let's create a model class ...
... an Ad post
Now, a JUnit Class
Call it PostTest,
to follow a name pattern
Confirm to add JUnit library
First things first:
setup() and tearDown()
Add a couple of methods to
     our model class
Let's add some tests!
Here we go: Run As => JUnit Test
All tests passed!
Time for the TestSuite
Let's call it PostTestSuite
Use it with PostTest.class
Let's try it out!
Here you have it:
JUnit's Swing GUI
Introducing new model attribute:
             price
Reflect that in our TestCase
  and re-run JUnit test ...
Oops! Test failed.
              failed
Can you figure out why?
Further reading

   JUnit FAQ
    http://junit.sourceforge.net/doc/faq/faq.htm

   JUnit
    http://www.junit.org

More Related Content

Similar to Junit for SE Class 2008/2009

Machine Learning with Microsoft by Nalin Mujumdar
Machine Learning with Microsoft by Nalin MujumdarMachine Learning with Microsoft by Nalin Mujumdar
Machine Learning with Microsoft by Nalin MujumdarAnindita Bhattacharya
 
AddQ Testautomatiseringserfarenheter
AddQ TestautomatiseringserfarenheterAddQ Testautomatiseringserfarenheter
AddQ TestautomatiseringserfarenheterAddQ Consulting
 
2011 py con
2011 py con2011 py con
2011 py conEing Ong
 
Harnessing the power of Generative Adversarial Networks (GANs) for supervised...
Harnessing the power of Generative Adversarial Networks (GANs) for supervised...Harnessing the power of Generative Adversarial Networks (GANs) for supervised...
Harnessing the power of Generative Adversarial Networks (GANs) for supervised...Scaleway
 
Ruby on Rails - The Best Track for your Start Up
Ruby on Rails - The Best Track for your Start UpRuby on Rails - The Best Track for your Start Up
Ruby on Rails - The Best Track for your Start UpPrateek Saxena
 
Open Source (2009)
Open Source (2009)Open Source (2009)
Open Source (2009)Eddie Vega
 
Practical Machine Learning
Practical Machine LearningPractical Machine Learning
Practical Machine LearningDavid Jones
 
How I hacked the Google Daydream controller
How I hacked the Google Daydream controllerHow I hacked the Google Daydream controller
How I hacked the Google Daydream controllerMatteo Pisani
 
Math in the News: Issue 87
Math in the News: Issue 87Math in the News: Issue 87
Math in the News: Issue 87Media4math
 

Similar to Junit for SE Class 2008/2009 (11)

Machine Learning with Microsoft by Nalin Mujumdar
Machine Learning with Microsoft by Nalin MujumdarMachine Learning with Microsoft by Nalin Mujumdar
Machine Learning with Microsoft by Nalin Mujumdar
 
67WS Seminar Event
67WS Seminar Event67WS Seminar Event
67WS Seminar Event
 
AddQ Testautomatiseringserfarenheter
AddQ TestautomatiseringserfarenheterAddQ Testautomatiseringserfarenheter
AddQ Testautomatiseringserfarenheter
 
2011 py con
2011 py con2011 py con
2011 py con
 
Java Performance Tuning
Java Performance TuningJava Performance Tuning
Java Performance Tuning
 
Harnessing the power of Generative Adversarial Networks (GANs) for supervised...
Harnessing the power of Generative Adversarial Networks (GANs) for supervised...Harnessing the power of Generative Adversarial Networks (GANs) for supervised...
Harnessing the power of Generative Adversarial Networks (GANs) for supervised...
 
Ruby on Rails - The Best Track for your Start Up
Ruby on Rails - The Best Track for your Start UpRuby on Rails - The Best Track for your Start Up
Ruby on Rails - The Best Track for your Start Up
 
Open Source (2009)
Open Source (2009)Open Source (2009)
Open Source (2009)
 
Practical Machine Learning
Practical Machine LearningPractical Machine Learning
Practical Machine Learning
 
How I hacked the Google Daydream controller
How I hacked the Google Daydream controllerHow I hacked the Google Daydream controller
How I hacked the Google Daydream controller
 
Math in the News: Issue 87
Math in the News: Issue 87Math in the News: Issue 87
Math in the News: Issue 87
 

Recently uploaded

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 

Recently uploaded (20)

"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 

Junit for SE Class 2008/2009