SlideShare ist ein Scribd-Unternehmen logo
1 von 17
Introduction Unit Testing Framework
System.out.println("Bug or But");
logger.info("Bug or But");
How to find the information in so many messages ?
Watch the var by debugger, but ...... manually
Can testing save your life ?
Automatic unit testing can save your life !
Automatic => uniform testing tool Unit testing => divide and conquer
JUnit Testing `Framework' Framework =>  almost completed except for … You must write Test Case
Eating Framework with CookCallback/Strategy http://www.bubbleliao.idv.tw/gallery/main.php?g2_view=core.DownloadItem&g2_itemId=11702&g2_serialNumber=1
In OO-System What are Unit and Test Case ?
Unit => A class Or related Classes Test Case => condition, state, behavior
DO TEST Make a change to a runtime object snapshot Assert Before => Condition, State, Behavior <= After
Write Test Case in AAA, 3 steps A rrange,  A ct and  A ssert
Arrange Simulate a runtime object snapshot Create a instance to set up its state and related object
Act Send messages to object (invoke the method) (make a change)
Assert Check state in object is just what you expect

Weitere ähnliche Inhalte

Was ist angesagt?

Exception Handling Mechanism in .NET CLR
Exception Handling Mechanism in .NET CLRException Handling Mechanism in .NET CLR
Exception Handling Mechanism in .NET CLR
Kiran Munir
 
Java exception handling
Java exception handlingJava exception handling
Java exception handling
BHUVIJAYAVELU
 
Krazykoder struts2 interceptors
Krazykoder struts2 interceptorsKrazykoder struts2 interceptors
Krazykoder struts2 interceptors
Krazy Koder
 

Was ist angesagt? (20)

Exception handling
Exception handling Exception handling
Exception handling
 
Exception handling in java
Exception handling in javaException handling in java
Exception handling in java
 
Exception Handling Mechanism in .NET CLR
Exception Handling Mechanism in .NET CLRException Handling Mechanism in .NET CLR
Exception Handling Mechanism in .NET CLR
 
javaexceptions
javaexceptionsjavaexceptions
javaexceptions
 
Junit
JunitJunit
Junit
 
3 j unit
3 j unit3 j unit
3 j unit
 
Exception handling in ASP .NET
Exception handling in ASP .NETException handling in ASP .NET
Exception handling in ASP .NET
 
Exception handling
Exception handlingException handling
Exception handling
 
Exception handling
Exception handlingException handling
Exception handling
 
Exception handling in java
Exception handling  in javaException handling  in java
Exception handling in java
 
Best Practices in Exception Handling
Best Practices in Exception HandlingBest Practices in Exception Handling
Best Practices in Exception Handling
 
exception handling
exception handlingexception handling
exception handling
 
Unit testing with JUnit
Unit testing with JUnitUnit testing with JUnit
Unit testing with JUnit
 
Java exception handling
Java exception handlingJava exception handling
Java exception handling
 
Krazykoder struts2 interceptors
Krazykoder struts2 interceptorsKrazykoder struts2 interceptors
Krazykoder struts2 interceptors
 
Exception handling in java
Exception handling  in javaException handling  in java
Exception handling in java
 
Exceptionhandling
ExceptionhandlingExceptionhandling
Exceptionhandling
 
JUnit & Mockito, first steps
JUnit & Mockito, first stepsJUnit & Mockito, first steps
JUnit & Mockito, first steps
 
Automated Unit Testing
Automated Unit TestingAutomated Unit Testing
Automated Unit Testing
 
Java Exception handling
Java Exception handlingJava Exception handling
Java Exception handling
 

Andere mochten auch (13)

Android NDK (JUG@TW 2011, Oct.)
Android NDK (JUG@TW 2011, Oct.)Android NDK (JUG@TW 2011, Oct.)
Android NDK (JUG@TW 2011, Oct.)
 
Java Build Tool course in 2011
Java Build Tool course in 2011Java Build Tool course in 2011
Java Build Tool course in 2011
 
idea: talk about the Active Cache
idea: talk about the Active Cacheidea: talk about the Active Cache
idea: talk about the Active Cache
 
JCConf2015: groovy to gradle
 JCConf2015: groovy to gradle JCConf2015: groovy to gradle
JCConf2015: groovy to gradle
 
Linking error
Linking errorLinking error
Linking error
 
Osgi Intro
Osgi IntroOsgi Intro
Osgi Intro
 
using Queue Server for batch processing
using Queue Server for batch processingusing Queue Server for batch processing
using Queue Server for batch processing
 
Talk about fabric
Talk about fabricTalk about fabric
Talk about fabric
 
OSGi Small Lab
OSGi Small LabOSGi Small Lab
OSGi Small Lab
 
Java web programming
Java web programmingJava web programming
Java web programming
 
JCConf2016 Jenkins Pipeline
JCConf2016 Jenkins PipelineJCConf2016 Jenkins Pipeline
JCConf2016 Jenkins Pipeline
 
老舊web上雲端
老舊web上雲端老舊web上雲端
老舊web上雲端
 
The journey of Moving from AWS ELK to GCP Data Pipeline
The journey of Moving from AWS ELK to GCP Data PipelineThe journey of Moving from AWS ELK to GCP Data Pipeline
The journey of Moving from AWS ELK to GCP Data Pipeline
 

Ähnlich wie Unit Testing

J unit presentation
J unit presentationJ unit presentation
J unit presentation
Priya Sharma
 
10reasons
10reasons10reasons
10reasons
Li Huan
 
Software Testing - Invited Lecture at UNSW Sydney
Software Testing - Invited Lecture at UNSW SydneySoftware Testing - Invited Lecture at UNSW Sydney
Software Testing - Invited Lecture at UNSW Sydney
julien.ponge
 
Qtp 9.2 tutorials
Qtp 9.2 tutorialsQtp 9.2 tutorials
Qtp 9.2 tutorials
medsherb
 
QTP with Descriptive programming
QTP with Descriptive programmingQTP with Descriptive programming
QTP with Descriptive programming
Kuldeep Sharma
 
Qtp with descriptive programming
Qtp with descriptive programmingQtp with descriptive programming
Qtp with descriptive programming
medsherb
 
Qtp With Descriptive Programming
Qtp With Descriptive ProgrammingQtp With Descriptive Programming
Qtp With Descriptive Programming
Kuldeep Sharma
 

Ähnlich wie Unit Testing (20)

Test Infected Presentation
Test Infected PresentationTest Infected Presentation
Test Infected Presentation
 
Code igniter unittest-part1
Code igniter unittest-part1Code igniter unittest-part1
Code igniter unittest-part1
 
J Unit
J UnitJ Unit
J Unit
 
Mockito with a hint of PowerMock
Mockito with a hint of PowerMockMockito with a hint of PowerMock
Mockito with a hint of PowerMock
 
J unit presentation
J unit presentationJ unit presentation
J unit presentation
 
JUnit Presentation
JUnit PresentationJUnit Presentation
JUnit Presentation
 
Rich GUI Testing: Swing and JavaFX
Rich GUI Testing: Swing and JavaFXRich GUI Testing: Swing and JavaFX
Rich GUI Testing: Swing and JavaFX
 
Rich GUI Testing: Swing and JavaFX
Rich GUI Testing: Swing and JavaFXRich GUI Testing: Swing and JavaFX
Rich GUI Testing: Swing and JavaFX
 
10reasons
10reasons10reasons
10reasons
 
Software Testing - Invited Lecture at UNSW Sydney
Software Testing - Invited Lecture at UNSW SydneySoftware Testing - Invited Lecture at UNSW Sydney
Software Testing - Invited Lecture at UNSW Sydney
 
Presentation Unit Testing process
Presentation Unit Testing processPresentation Unit Testing process
Presentation Unit Testing process
 
Ant Unit Your Functional Test
Ant Unit Your Functional TestAnt Unit Your Functional Test
Ant Unit Your Functional Test
 
QTP 9.2
QTP 9.2QTP 9.2
QTP 9.2
 
Qtp 9.2 tutorials
Qtp 9.2 tutorialsQtp 9.2 tutorials
Qtp 9.2 tutorials
 
QTP with Descriptive programming
QTP with Descriptive programmingQTP with Descriptive programming
QTP with Descriptive programming
 
Qtp with descriptive programming
Qtp with descriptive programmingQtp with descriptive programming
Qtp with descriptive programming
 
Qtp With Descriptive Programming
Qtp With Descriptive ProgrammingQtp With Descriptive Programming
Qtp With Descriptive Programming
 
Testing android apps with espresso
Testing android apps with espressoTesting android apps with espresso
Testing android apps with espresso
 
Dhanasekaran 2008-2009 Quick Test Pro Presentation
Dhanasekaran 2008-2009 Quick Test Pro PresentationDhanasekaran 2008-2009 Quick Test Pro Presentation
Dhanasekaran 2008-2009 Quick Test Pro Presentation
 
First QTP Tutorial
First QTP TutorialFirst QTP Tutorial
First QTP Tutorial
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

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
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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?
 
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
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
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
 
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
 

Unit Testing