SlideShare une entreprise Scribd logo
1  sur  32
Télécharger pour lire hors ligne
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

Contenu connexe

Similaire à Junit for SE Class 2008/2009

AddQ Testautomatiseringserfarenheter
AddQ TestautomatiseringserfarenheterAddQ Testautomatiseringserfarenheter
AddQ Testautomatiseringserfarenheter
AddQ Consulting
 
2011 py con
2011 py con2011 py con
2011 py con
Eing 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
 

Similaire à 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
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

Junit for SE Class 2008/2009