SlideShare une entreprise Scribd logo
1  sur  9
Unit Test Programming -
Session 2
Amin Arab
Sharivar 98
Tosan
https://www.linkedin.com/in/amin-arab-a653b13a/
Mocking
• Min , max Calls
• Exception Handling
• Ordered Verification
• Callbacks
• Create Mock
• Spying
• Resetting Mock
• Timeouts
• Argument matchers
• doNothing
Best Practice
• One assertion per test method (Scenario)
• Use matchers when parameter value has not effect on scenario
• Mr Ebrahimi Presentation
• LoginHistoryBLTestSuite Review
• Test Organization
• Code Coverage
Test Policies
• Name Convention
• Test Organization
• Minimum Suites
• TestCase per method or class
• Code Coverage Percent
Code Coverage
Eclemma
XUnit Patterns
BDD
References
• https://www.mkyong.com/tutorials/junit-tutorials/
• https://eclemma.org
• https://www.tutorialspoint.com/mockito
• https://www.baeldung.com/mockito-vs-easymock-vs-jmockit
• https://www.baeldung.com/powermock-private-method
Codes
• https://github.com/aminarab/Mockito-Training

Contenu connexe

Similaire à Unit test programming session 2

Moq presentation
Moq presentationMoq presentation
Moq presentation
LynxStar
 
TRACK F: Improving Utilization of Acceleration Platforms by Using Off-Platfor...
TRACK F: Improving Utilization of Acceleration Platforms by Using Off-Platfor...TRACK F: Improving Utilization of Acceleration Platforms by Using Off-Platfor...
TRACK F: Improving Utilization of Acceleration Platforms by Using Off-Platfor...
chiportal
 
Системный взгляд на параллельный запуск Selenium тестов
Системный взгляд на параллельный запуск Selenium тестовСистемный взгляд на параллельный запуск Selenium тестов
Системный взгляд на параллельный запуск Selenium тестов
COMAQA.BY
 
Fuzzing101 - webinar on Fuzzing Performance
Fuzzing101 - webinar on Fuzzing PerformanceFuzzing101 - webinar on Fuzzing Performance
Fuzzing101 - webinar on Fuzzing Performance
Codenomicon
 

Similaire à Unit test programming session 2 (20)

Distributed Automation(2018) - London Test Automation in Devops Meetup
Distributed Automation(2018) - London Test Automation in Devops MeetupDistributed Automation(2018) - London Test Automation in Devops Meetup
Distributed Automation(2018) - London Test Automation in Devops Meetup
 
How to use selenium successfully
How to use selenium successfullyHow to use selenium successfully
How to use selenium successfully
 
TLC2018 Thomas Haver: The Automation Firehose - Be Strategic and Tactical
TLC2018 Thomas Haver: The Automation Firehose - Be Strategic and TacticalTLC2018 Thomas Haver: The Automation Firehose - Be Strategic and Tactical
TLC2018 Thomas Haver: The Automation Firehose - Be Strategic and Tactical
 
Junit, mockito, etc
Junit, mockito, etcJunit, mockito, etc
Junit, mockito, etc
 
Kaggle nlp approaches
Kaggle nlp approachesKaggle nlp approaches
Kaggle nlp approaches
 
Testing the Untestable
Testing the UntestableTesting the Untestable
Testing the Untestable
 
Test automation engineer
Test automation engineerTest automation engineer
Test automation engineer
 
Barcamp Bangkhen :: Robot Framework
Barcamp Bangkhen :: Robot FrameworkBarcamp Bangkhen :: Robot Framework
Barcamp Bangkhen :: Robot Framework
 
Moq Presentation
Moq PresentationMoq Presentation
Moq Presentation
 
Moq presentation
Moq presentationMoq presentation
Moq presentation
 
Testing strategies in microservices
Testing strategies in microservicesTesting strategies in microservices
Testing strategies in microservices
 
CIM Compliance.pptx
CIM Compliance.pptxCIM Compliance.pptx
CIM Compliance.pptx
 
Amazon SageMaker で始める機械学習
Amazon SageMaker で始める機械学習Amazon SageMaker で始める機械学習
Amazon SageMaker で始める機械学習
 
TRACK F: Improving Utilization of Acceleration Platforms by Using Off-Platfor...
TRACK F: Improving Utilization of Acceleration Platforms by Using Off-Platfor...TRACK F: Improving Utilization of Acceleration Platforms by Using Off-Platfor...
TRACK F: Improving Utilization of Acceleration Platforms by Using Off-Platfor...
 
Introduction to red team operations
Introduction to red team operationsIntroduction to red team operations
Introduction to red team operations
 
Quickly Testing Legacy Cpp Code - ACCU Cambridge 2019
Quickly Testing Legacy Cpp Code - ACCU Cambridge 2019Quickly Testing Legacy Cpp Code - ACCU Cambridge 2019
Quickly Testing Legacy Cpp Code - ACCU Cambridge 2019
 
Detection Rules Coverage
Detection Rules CoverageDetection Rules Coverage
Detection Rules Coverage
 
Системный взгляд на параллельный запуск Selenium тестов
Системный взгляд на параллельный запуск Selenium тестовСистемный взгляд на параллельный запуск Selenium тестов
Системный взгляд на параллельный запуск Selenium тестов
 
Fuzzing101 - webinar on Fuzzing Performance
Fuzzing101 - webinar on Fuzzing PerformanceFuzzing101 - webinar on Fuzzing Performance
Fuzzing101 - webinar on Fuzzing Performance
 
Beginners overview of automated testing with Rspec
Beginners overview of automated testing with RspecBeginners overview of automated testing with Rspec
Beginners overview of automated testing with Rspec
 

Plus de Amin Arab (10)

Session 4
Session 4Session 4
Session 4
 
JavaEE Session 3
JavaEE Session 3JavaEE Session 3
JavaEE Session 3
 
JavaEE 8 Introduction - Session 3
JavaEE 8 Introduction - Session 3JavaEE 8 Introduction - Session 3
JavaEE 8 Introduction - Session 3
 
JavaEE 8 Introduction - Session 2
JavaEE 8 Introduction - Session 2JavaEE 8 Introduction - Session 2
JavaEE 8 Introduction - Session 2
 
JavaEE 8 Introduction - Session 1
JavaEE 8 Introduction - Session 1JavaEE 8 Introduction - Session 1
JavaEE 8 Introduction - Session 1
 
Unit test programming session 1
Unit test programming   session 1Unit test programming   session 1
Unit test programming session 1
 
Micro service session 2
Micro service   session 2Micro service   session 2
Micro service session 2
 
Micro service session 1
Micro service   session 1Micro service   session 1
Micro service session 1
 
Docker
DockerDocker
Docker
 
Dev ops
Dev opsDev ops
Dev ops
 

Dernier

Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 

Dernier (20)

A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
PE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and propertiesPE 459 LECTURE 2- natural gas basic concepts and properties
PE 459 LECTURE 2- natural gas basic concepts and properties
 
DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 

Unit test programming session 2