SlideShare a Scribd company logo
1 of 40
Download to read offline
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
1
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
2
http://less.works/less/technical-excellence/unit-testing.html
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
3
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Why not write Unit test ?
4
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Why not write Unit test ?
5
Testing for QA Time = Cost
Integration testing find more bugs
Manual testing find more bugs
Write more code
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Waste time ?
6
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Waste time ?
7
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Why Unit test ?
8
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Anatomy JUnit 4
Test Name
Test Case NameAnnotation
9
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Test Naming
10
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
“What ’s in a name ?”
That which we call a rose
by any other name would smell
Romeo and Juliet
as sweet
11
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Don’t say “test”, say “should”
Guide to Test Writing
12
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Don’t use the word “test”
13
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Use the word “should”
14
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Don’t test your class, test behaviour
Guide to Test Writing
15
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Test class names are important too
Structure your test well
Guide to Test Writing
16
Tests are deliverable too
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Test Structure
17
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
The ratio of time spent (code)
versus writing is
over 10 to 1
Robert C. Martin, Clean Code
18
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Good Unit Test
Arrange
Act
Assert
19
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Setup Pattern
20
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Setup Pattern
Inline
Setup
21
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Setup Pattern
Delegate
Setup
22
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Setup Pattern
Implicit
Setup
23
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Implicit Teardown
24
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Ignore Testcase
25
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Handle Exception
26
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Traditional approach
27
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Expected Annotation
28
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
ExpectedException Rule
29
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Data-Driven with JUnit
30
@Parameterized
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Set of test data
Using parameterized
31
Expected result
Define test that uses the test data
Verify result against expected result
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Data-Driven Development
32
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
@Parameterized
with Calculate Grade
Demo
33
Input Expected Result
80 A
70 B
60 C
50 D
40 F
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Step 1 :: Test Data
34
Input Expected Result
80 A
70 B
60 C
50 D
40 F
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Step 2 :: Add Runner
35
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Step 3 :: Matching fields
36
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Step 4 :: Define test case
37
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Step 5 :: Add @parameters
38
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Step 6 :: Test Result
39
SPRINT3R
Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance
Why not write Unit test ?
40

More Related Content

Viewers also liked

Текущее положение дел и перспективы развития архивной отрасли
Текущее положение дел и перспективы развития архивной отраслиТекущее положение дел и перспективы развития архивной отрасли
Текущее положение дел и перспективы развития архивной отрасли
Natasha Khramtsovsky
 
hhsaplit5bs
hhsaplit5bshhsaplit5bs
hhsaplit5bs
bsisco
 
Руководство NARA по управлению документами в электронной почте
Руководство NARA по управлению документами в электронной почтеРуководство NARA по управлению документами в электронной почте
Руководство NARA по управлению документами в электронной почте
Natasha Khramtsovsky
 
Library Liaison Ver. 2.x
Library Liaison Ver. 2.xLibrary Liaison Ver. 2.x
Library Liaison Ver. 2.x
Bruce Gilbert
 
PROEXPOSURE Communications Training Courses
PROEXPOSURE Communications Training Courses PROEXPOSURE Communications Training Courses
PROEXPOSURE Communications Training Courses
PROEXPOSURE CIC
 
PROEXPOSURE We are family
PROEXPOSURE We are familyPROEXPOSURE We are family
PROEXPOSURE We are family
PROEXPOSURE CIC
 
機器人
機器人機器人
機器人
qwer1
 
Ana Mallen
Ana MallenAna Mallen
Ana Mallen
torie
 

Viewers also liked (20)

Planificació 2
Planificació 2Planificació 2
Planificació 2
 
Зарубежный опыт создания государственных электронных архивов
Зарубежный опыт создания государственных электронных архивовЗарубежный опыт создания государственных электронных архивов
Зарубежный опыт создания государственных электронных архивов
 
Gruppo Sanniti: Individuazione di obiettivi trasversali per classi del trienn...
Gruppo Sanniti: Individuazione di obiettivi trasversali per classi del trienn...Gruppo Sanniti: Individuazione di obiettivi trasversali per classi del trienn...
Gruppo Sanniti: Individuazione di obiettivi trasversali per classi del trienn...
 
Panel Internet & la educación y la cultura
Panel Internet & la educación y la culturaPanel Internet & la educación y la cultura
Panel Internet & la educación y la cultura
 
Текущее положение дел и перспективы развития архивной отрасли
Текущее положение дел и перспективы развития архивной отраслиТекущее положение дел и перспективы развития архивной отрасли
Текущее положение дел и перспективы развития архивной отрасли
 
hhsaplit5bs
hhsaplit5bshhsaplit5bs
hhsaplit5bs
 
Руководство NARA по управлению документами в электронной почте
Руководство NARA по управлению документами в электронной почтеРуководство NARA по управлению документами в электронной почте
Руководство NARA по управлению документами в электронной почте
 
Photo Album Cunningham
Photo Album CunninghamPhoto Album Cunningham
Photo Album Cunningham
 
Library Liaison Ver. 2.x
Library Liaison Ver. 2.xLibrary Liaison Ver. 2.x
Library Liaison Ver. 2.x
 
Level2 OPS-toets (bijdrage 1)
Level2 OPS-toets (bijdrage 1)Level2 OPS-toets (bijdrage 1)
Level2 OPS-toets (bijdrage 1)
 
Presentatie G1000
Presentatie G1000Presentatie G1000
Presentatie G1000
 
Timotheus vanuit een multilevelbril
Timotheus vanuit een multilevelbrilTimotheus vanuit een multilevelbril
Timotheus vanuit een multilevelbril
 
Climate Impacts Agustin
Climate  Impacts AgustinClimate  Impacts Agustin
Climate Impacts Agustin
 
Gkacdm session-miniproject
Gkacdm session-miniprojectGkacdm session-miniproject
Gkacdm session-miniproject
 
PROEXPOSURE Communications Training Courses
PROEXPOSURE Communications Training Courses PROEXPOSURE Communications Training Courses
PROEXPOSURE Communications Training Courses
 
PROEXPOSURE We are family
PROEXPOSURE We are familyPROEXPOSURE We are family
PROEXPOSURE We are family
 
機器人
機器人機器人
機器人
 
Geeky Academy Week 3 :: Vagrant + Puppet
Geeky Academy Week 3 :: Vagrant + PuppetGeeky Academy Week 3 :: Vagrant + Puppet
Geeky Academy Week 3 :: Vagrant + Puppet
 
Thewiseoldman
ThewiseoldmanThewiseoldman
Thewiseoldman
 
Ana Mallen
Ana MallenAna Mallen
Ana Mallen
 

Similar to Something About jUnit

Tlc 1223618496327769-9
Tlc 1223618496327769-9Tlc 1223618496327769-9
Tlc 1223618496327769-9
krunal yagnik
 
TESTING LIFE CYCLE PPT
TESTING LIFE CYCLE PPTTESTING LIFE CYCLE PPT
TESTING LIFE CYCLE PPT
suhasreddy1
 

Similar to Something About jUnit (16)

Sprint3r tpse2014-atdd-with-robot-framework
Sprint3r tpse2014-atdd-with-robot-frameworkSprint3r tpse2014-atdd-with-robot-framework
Sprint3r tpse2014-atdd-with-robot-framework
 
Introduction to Elasticsearch
Introduction to ElasticsearchIntroduction to Elasticsearch
Introduction to Elasticsearch
 
Introduction to elasticsearch fast lane
Introduction to elasticsearch fast laneIntroduction to elasticsearch fast lane
Introduction to elasticsearch fast lane
 
Tlc 1223618496327769-9
Tlc 1223618496327769-9Tlc 1223618496327769-9
Tlc 1223618496327769-9
 
TESTING LIFE CYCLE PPT
TESTING LIFE CYCLE PPTTESTING LIFE CYCLE PPT
TESTING LIFE CYCLE PPT
 
Test Cases in Software Testing Examples PDF By QA Company in USA
Test Cases in Software Testing Examples PDF By QA Company in USATest Cases in Software Testing Examples PDF By QA Company in USA
Test Cases in Software Testing Examples PDF By QA Company in USA
 
AIML Webinar - Improve Education Outcomes
AIML Webinar - Improve Education OutcomesAIML Webinar - Improve Education Outcomes
AIML Webinar - Improve Education Outcomes
 
Applying Maching Learning to Build Smarter Video Workflows
Applying Maching Learning to Build Smarter Video WorkflowsApplying Maching Learning to Build Smarter Video Workflows
Applying Maching Learning to Build Smarter Video Workflows
 
Cause-Effect Graphing: Rigorous Test Case Design
Cause-Effect Graphing: Rigorous Test Case DesignCause-Effect Graphing: Rigorous Test Case Design
Cause-Effect Graphing: Rigorous Test Case Design
 
Improving Defect Yield - a three step approach
Improving Defect Yield - a three step approachImproving Defect Yield - a three step approach
Improving Defect Yield - a three step approach
 
Attachment Report Presentation
Attachment Report Presentation Attachment Report Presentation
Attachment Report Presentation
 
Akshit gupta management_science
Akshit gupta management_scienceAkshit gupta management_science
Akshit gupta management_science
 
Atdd half day_new_1_up
Atdd half day_new_1_upAtdd half day_new_1_up
Atdd half day_new_1_up
 
AI/ML Week: Improve Education Outcomes
AI/ML Week: Improve Education OutcomesAI/ML Week: Improve Education Outcomes
AI/ML Week: Improve Education Outcomes
 
MITRE ATT&CKcon 2.0: Lessons in Purple Team Testing with MITRE ATT&CK; Daniel...
MITRE ATT&CKcon 2.0: Lessons in Purple Team Testing with MITRE ATT&CK; Daniel...MITRE ATT&CKcon 2.0: Lessons in Purple Team Testing with MITRE ATT&CK; Daniel...
MITRE ATT&CKcon 2.0: Lessons in Purple Team Testing with MITRE ATT&CK; Daniel...
 
Human-in-the-Loop for Machine Learning (AIM358-R1) - AWS re:Invent 2018
Human-in-the-Loop for Machine Learning (AIM358-R1) - AWS re:Invent 2018Human-in-the-Loop for Machine Learning (AIM358-R1) - AWS re:Invent 2018
Human-in-the-Loop for Machine Learning (AIM358-R1) - AWS re:Invent 2018
 

More from Somkiat Puisungnoen

More from Somkiat Puisungnoen (20)

Next of Java 2022
Next of Java 2022Next of Java 2022
Next of Java 2022
 
Sck spring-reactive
Sck spring-reactiveSck spring-reactive
Sck spring-reactive
 
Part 2 :: Spring Boot testing
Part 2 :: Spring Boot testingPart 2 :: Spring Boot testing
Part 2 :: Spring Boot testing
 
vTalk#1 Microservices with Spring Boot
vTalk#1 Microservices with Spring BootvTalk#1 Microservices with Spring Boot
vTalk#1 Microservices with Spring Boot
 
Lesson learned from React native and Flutter
Lesson learned from React native and FlutterLesson learned from React native and Flutter
Lesson learned from React native and Flutter
 
devops
devops devops
devops
 
Angular :: basic tuning performance
Angular :: basic tuning performanceAngular :: basic tuning performance
Angular :: basic tuning performance
 
Shared code between projects
Shared code between projectsShared code between projects
Shared code between projects
 
Distributed Tracing
Distributed Tracing Distributed Tracing
Distributed Tracing
 
Manage data of service
Manage data of serviceManage data of service
Manage data of service
 
RobotFramework Meetup at Thailand #2
RobotFramework Meetup at Thailand #2RobotFramework Meetup at Thailand #2
RobotFramework Meetup at Thailand #2
 
Visual testing
Visual testingVisual testing
Visual testing
 
Cloud Native App
Cloud Native AppCloud Native App
Cloud Native App
 
Wordpress for Newbie
Wordpress for NewbieWordpress for Newbie
Wordpress for Newbie
 
Sck Agile in Real World
Sck Agile in Real WorldSck Agile in Real World
Sck Agile in Real World
 
Clean you code
Clean you codeClean you code
Clean you code
 
SCK Firestore at CNX
SCK Firestore at CNXSCK Firestore at CNX
SCK Firestore at CNX
 
Unhappiness Developer
Unhappiness DeveloperUnhappiness Developer
Unhappiness Developer
 
The Beauty of BAD code
The Beauty of  BAD codeThe Beauty of  BAD code
The Beauty of BAD code
 
React in the right way
React in the right wayReact in the right way
React in the right way
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
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
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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
 
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
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 

Something About jUnit