SlideShare uma empresa Scribd logo
1 de 32
Baixar para ler 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

Mais conteúdo relacionado

Semelhante a 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
 

Semelhante a 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
 

Último

Último (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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...
 
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
 
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
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
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
 
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
 

Junit for SE Class 2008/2009