SlideShare a Scribd company logo
Unit Test in a nutshell 
Short presentation of a method to verify isolated units of code 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
About me 
Roberto Bettazzoni 
Agile Coach 
eXtreme Programming Trainer 
! 
Certified Scrum Professional 
>30 years of coding (and still proudly counting) 
! 
roberto.bettazzoni@agile42.com 
linkedin.com/in/robertobettazzoni 
@bettazzoni 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
unit test 
Method to verify isolated units of code 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
unit test 
user 
code 
Acceptance Criteria test 
Functional test 
Unit test 
Unit tests are written 
by coders for coders 
to test the code design 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
unit test 
Method to verify isolated units of code 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
unit test 
Method to verify isolated units of code 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
unit test 
assert( condition ) 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
unit test library 
assert( bool condition ) 
assertEqual( <T> a, <T> b ) 
assertEqual( float a, float b, float precision) 
assertThrow( exceptionType, function) 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
unit test 
Method to verify isolated units of code 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
Test Isolation 
A 
B 
C 
D 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
Test Isolation 
Run 4 tests: A, B, C, D 
A 
B 
C 
D 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
Test Isolation 
A 
B 
C 
D 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
Test Isolation 
Run 3 tests: A, B, D 
A 
B 
D 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
Test Isolation 
Run 3 tests: D, A, B 
D 
A 
B 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
unit test library 
test() 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
unit test library 
setup() - test() - teardown() 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
unit test library 
Test Class also known as TestCase or TestFixture 
{ 
setup() {} 
teardown() {} 
! 
test_method_1() 
test_method_2() 
test_method_3() 
} 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
unit test library 
Test Class also known as TestCase or TestFixture 
setup() - test_method_1() - teardown() 
setup() - test_method_2() - teardown() 
setup() - test_method_3() - teardown() 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
unit test 
Method to verify isolated units of code 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
unit test - What is a unit of code? 
Classes 
Methods 
Functions 
Blocks of code 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
Code Isolation (or Unit Isolation) 
A 
B 
C 
D 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
Code Isolation (or Unit Isolation) 
A 
B 
C 
D 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
Take a guess 
What makes a “good unit test”? 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
Take a guess 
What makes a “good unit test”? 
Readability 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
Food for thoughts 
agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License

More Related Content

What's hot

Agile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated TestingAgile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated Testing
Dimitri Ponomareff
 
Writing Testable Code
Writing Testable CodeWriting Testable Code
Writing Testable Code
jameshalsall
 
Agile testing - Testing From Day 1
Agile testing - Testing From Day 1Agile testing - Testing From Day 1
Agile testing - Testing From Day 1
Kaizenko
 
Certified Professional Master Agile Testing information and highlights
Certified Professional Master Agile Testing  information and highlightsCertified Professional Master Agile Testing  information and highlights
Certified Professional Master Agile Testing information and highlights
Agile Testing Alliance
 
Test Automation Strategies for the Agile World
Test Automation Strategies for the Agile WorldTest Automation Strategies for the Agile World
Test Automation Strategies for the Agile World
TechWell
 
QA in Agile World
QA in Agile WorldQA in Agile World
QA in Agile World
Tathagat Varma
 
Agile engineering practices – a short overview
Agile engineering practices – a short overviewAgile engineering practices – a short overview
Agile engineering practices – a short overview
Serhiy Yevtushenko
 
#TesterbhiCoder - Every Tester should get into coding - Selenium automation
#TesterbhiCoder - Every Tester should get into coding - Selenium automation#TesterbhiCoder - Every Tester should get into coding - Selenium automation
#TesterbhiCoder - Every Tester should get into coding - Selenium automation
Agile Testing Alliance
 
#BugATAhon2016 #WhoHasKeeda
#BugATAhon2016 #WhoHasKeeda#BugATAhon2016 #WhoHasKeeda
#BugATAhon2016 #WhoHasKeeda
Agile Testing Alliance
 
Agile tour ncr test360_degree - agile testing on steroids
Agile tour ncr test360_degree - agile testing on steroidsAgile tour ncr test360_degree - agile testing on steroids
Agile tour ncr test360_degree - agile testing on steroids
Vipul Gupta
 
(Agile) engineering best practices - What every project manager should know
(Agile) engineering best practices - What every project manager should know(Agile) engineering best practices - What every project manager should know
(Agile) engineering best practices - What every project manager should know
Richard Cheng
 
Agile test tools
Agile test toolsAgile test tools
Agile test tools
Agile Partner S.A.
 
ATA CP-MAT program highlights
ATA CP-MAT program highlightsATA CP-MAT program highlights
ATA CP-MAT program highlights
Agile Testing Alliance
 
Large-Scale Agile Test Automation Strategies in Practice
Large-Scale Agile Test Automation Strategies in PracticeLarge-Scale Agile Test Automation Strategies in Practice
Large-Scale Agile Test Automation Strategies in Practice
TechWell
 
Agile testing principles and practices - Anil Karade
Agile testing principles and practices - Anil KaradeAgile testing principles and practices - Anil Karade
Agile testing principles and practices - Anil Karade
IndicThreads
 
Agile Testing - presentation for Agile User Group
Agile Testing - presentation for Agile User GroupAgile Testing - presentation for Agile User Group
Agile Testing - presentation for Agile User Group
suwalki24.pl
 
The DevOps Dance - Shift Left, Shift Right - Get It Right
The DevOps Dance - Shift Left, Shift Right - Get It RightThe DevOps Dance - Shift Left, Shift Right - Get It Right
The DevOps Dance - Shift Left, Shift Right - Get It Right
Inflectra
 
A Concise QA Process
A Concise QA Process A Concise QA Process
A Concise QA Process
Arslan Ali
 
Test Automation Strategies For Agile
Test Automation Strategies For AgileTest Automation Strategies For Agile
Test Automation Strategies For Agile
Naresh Jain
 
What is Agile Testing?
What is Agile Testing?What is Agile Testing?
What is Agile Testing?
vodQA
 

What's hot (20)

Agile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated TestingAgile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated Testing
 
Writing Testable Code
Writing Testable CodeWriting Testable Code
Writing Testable Code
 
Agile testing - Testing From Day 1
Agile testing - Testing From Day 1Agile testing - Testing From Day 1
Agile testing - Testing From Day 1
 
Certified Professional Master Agile Testing information and highlights
Certified Professional Master Agile Testing  information and highlightsCertified Professional Master Agile Testing  information and highlights
Certified Professional Master Agile Testing information and highlights
 
Test Automation Strategies for the Agile World
Test Automation Strategies for the Agile WorldTest Automation Strategies for the Agile World
Test Automation Strategies for the Agile World
 
QA in Agile World
QA in Agile WorldQA in Agile World
QA in Agile World
 
Agile engineering practices – a short overview
Agile engineering practices – a short overviewAgile engineering practices – a short overview
Agile engineering practices – a short overview
 
#TesterbhiCoder - Every Tester should get into coding - Selenium automation
#TesterbhiCoder - Every Tester should get into coding - Selenium automation#TesterbhiCoder - Every Tester should get into coding - Selenium automation
#TesterbhiCoder - Every Tester should get into coding - Selenium automation
 
#BugATAhon2016 #WhoHasKeeda
#BugATAhon2016 #WhoHasKeeda#BugATAhon2016 #WhoHasKeeda
#BugATAhon2016 #WhoHasKeeda
 
Agile tour ncr test360_degree - agile testing on steroids
Agile tour ncr test360_degree - agile testing on steroidsAgile tour ncr test360_degree - agile testing on steroids
Agile tour ncr test360_degree - agile testing on steroids
 
(Agile) engineering best practices - What every project manager should know
(Agile) engineering best practices - What every project manager should know(Agile) engineering best practices - What every project manager should know
(Agile) engineering best practices - What every project manager should know
 
Agile test tools
Agile test toolsAgile test tools
Agile test tools
 
ATA CP-MAT program highlights
ATA CP-MAT program highlightsATA CP-MAT program highlights
ATA CP-MAT program highlights
 
Large-Scale Agile Test Automation Strategies in Practice
Large-Scale Agile Test Automation Strategies in PracticeLarge-Scale Agile Test Automation Strategies in Practice
Large-Scale Agile Test Automation Strategies in Practice
 
Agile testing principles and practices - Anil Karade
Agile testing principles and practices - Anil KaradeAgile testing principles and practices - Anil Karade
Agile testing principles and practices - Anil Karade
 
Agile Testing - presentation for Agile User Group
Agile Testing - presentation for Agile User GroupAgile Testing - presentation for Agile User Group
Agile Testing - presentation for Agile User Group
 
The DevOps Dance - Shift Left, Shift Right - Get It Right
The DevOps Dance - Shift Left, Shift Right - Get It RightThe DevOps Dance - Shift Left, Shift Right - Get It Right
The DevOps Dance - Shift Left, Shift Right - Get It Right
 
A Concise QA Process
A Concise QA Process A Concise QA Process
A Concise QA Process
 
Test Automation Strategies For Agile
Test Automation Strategies For AgileTest Automation Strategies For Agile
Test Automation Strategies For Agile
 
What is Agile Testing?
What is Agile Testing?What is Agile Testing?
What is Agile Testing?
 

Similar to Unit test in a nutshell

Agility meets regulatory compliance
Agility meets regulatory complianceAgility meets regulatory compliance
Agility meets regulatory compliance
Dave Sharrock
 
Useful Lean Tools: Value Stream Mapping and Kanban
Useful Lean Tools: Value Stream Mapping and KanbanUseful Lean Tools: Value Stream Mapping and Kanban
Useful Lean Tools: Value Stream Mapping and Kanban
Roberto Bettazzoni
 
Manual Testing Interview Questions | Edureka
Manual Testing Interview Questions | EdurekaManual Testing Interview Questions | Edureka
Manual Testing Interview Questions | Edureka
Edureka!
 
Ramesh Krishnamurthy, CTO at World DevOps Summit 2016
Ramesh Krishnamurthy, CTO at World DevOps Summit 2016Ramesh Krishnamurthy, CTO at World DevOps Summit 2016
Ramesh Krishnamurthy, CTO at World DevOps Summit 2016
Indium Software
 
Test Management Training
Test Management TrainingTest Management Training
Test Management Training
suhasreddy1
 
What is Agile Testing? Edureka
What is Agile Testing? EdurekaWhat is Agile Testing? Edureka
What is Agile Testing? Edureka
Edureka!
 
Software Testing Interview Questions & Answers | Edureka
Software Testing Interview Questions & Answers | EdurekaSoftware Testing Interview Questions & Answers | Edureka
Software Testing Interview Questions & Answers | Edureka
Edureka!
 
CookpadTechConf2018-(Mobile)TestAutomation
CookpadTechConf2018-(Mobile)TestAutomationCookpadTechConf2018-(Mobile)TestAutomation
CookpadTechConf2018-(Mobile)TestAutomation
Kazuaki Matsuo
 
IBM Innovate2014 - Is Agile Compliance an Oxymoron?
IBM Innovate2014 - Is Agile Compliance an Oxymoron? IBM Innovate2014 - Is Agile Compliance an Oxymoron?
IBM Innovate2014 - Is Agile Compliance an Oxymoron?
Dave Sharrock
 
Build Products Developers Love by fmr Twilio Staff Product Manager
Build Products Developers Love by fmr Twilio Staff Product ManagerBuild Products Developers Love by fmr Twilio Staff Product Manager
Build Products Developers Love by fmr Twilio Staff Product Manager
Product School
 
Quality Assurance Process
Quality Assurance ProcessQuality Assurance Process
Quality Assurance Process
Bala Subramanian
 
A journey to_be_a_software_craftsman
A journey to_be_a_software_craftsmanA journey to_be_a_software_craftsman
A journey to_be_a_software_craftsman
Jaehoon Oh
 
Software Testing
Software TestingSoftware Testing
Software Testing
Inocentshuja Ahmad
 
Thoughts on Lean Product Development at CAMUG, YYC Nov 2014
Thoughts on Lean Product Development at CAMUG, YYC Nov 2014Thoughts on Lean Product Development at CAMUG, YYC Nov 2014
Thoughts on Lean Product Development at CAMUG, YYC Nov 2014
Dave Sharrock
 
Shubhamangala_ST_3+yrs_Testing
Shubhamangala_ST_3+yrs_TestingShubhamangala_ST_3+yrs_Testing
Shubhamangala_ST_3+yrs_Testing
shubhamangala Ambershette
 
Software Testing Tutorial For Beginners | Manual & Automation Testing | Selen...
Software Testing Tutorial For Beginners | Manual & Automation Testing | Selen...Software Testing Tutorial For Beginners | Manual & Automation Testing | Selen...
Software Testing Tutorial For Beginners | Manual & Automation Testing | Selen...
Edureka!
 
Quality Assurance & Testing in a glimpse
Quality Assurance & Testing in a glimpseQuality Assurance & Testing in a glimpse
Quality Assurance & Testing in a glimpse
Tahmid Munaz
 
QA part 2
QA part 2QA part 2
QA part 2
Wayne Weixin
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
Sergey Aganezov
 
Spring AOP
Spring AOPSpring AOP
Spring AOP
AnushaNaidu
 

Similar to Unit test in a nutshell (20)

Agility meets regulatory compliance
Agility meets regulatory complianceAgility meets regulatory compliance
Agility meets regulatory compliance
 
Useful Lean Tools: Value Stream Mapping and Kanban
Useful Lean Tools: Value Stream Mapping and KanbanUseful Lean Tools: Value Stream Mapping and Kanban
Useful Lean Tools: Value Stream Mapping and Kanban
 
Manual Testing Interview Questions | Edureka
Manual Testing Interview Questions | EdurekaManual Testing Interview Questions | Edureka
Manual Testing Interview Questions | Edureka
 
Ramesh Krishnamurthy, CTO at World DevOps Summit 2016
Ramesh Krishnamurthy, CTO at World DevOps Summit 2016Ramesh Krishnamurthy, CTO at World DevOps Summit 2016
Ramesh Krishnamurthy, CTO at World DevOps Summit 2016
 
Test Management Training
Test Management TrainingTest Management Training
Test Management Training
 
What is Agile Testing? Edureka
What is Agile Testing? EdurekaWhat is Agile Testing? Edureka
What is Agile Testing? Edureka
 
Software Testing Interview Questions & Answers | Edureka
Software Testing Interview Questions & Answers | EdurekaSoftware Testing Interview Questions & Answers | Edureka
Software Testing Interview Questions & Answers | Edureka
 
CookpadTechConf2018-(Mobile)TestAutomation
CookpadTechConf2018-(Mobile)TestAutomationCookpadTechConf2018-(Mobile)TestAutomation
CookpadTechConf2018-(Mobile)TestAutomation
 
IBM Innovate2014 - Is Agile Compliance an Oxymoron?
IBM Innovate2014 - Is Agile Compliance an Oxymoron? IBM Innovate2014 - Is Agile Compliance an Oxymoron?
IBM Innovate2014 - Is Agile Compliance an Oxymoron?
 
Build Products Developers Love by fmr Twilio Staff Product Manager
Build Products Developers Love by fmr Twilio Staff Product ManagerBuild Products Developers Love by fmr Twilio Staff Product Manager
Build Products Developers Love by fmr Twilio Staff Product Manager
 
Quality Assurance Process
Quality Assurance ProcessQuality Assurance Process
Quality Assurance Process
 
A journey to_be_a_software_craftsman
A journey to_be_a_software_craftsmanA journey to_be_a_software_craftsman
A journey to_be_a_software_craftsman
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
Thoughts on Lean Product Development at CAMUG, YYC Nov 2014
Thoughts on Lean Product Development at CAMUG, YYC Nov 2014Thoughts on Lean Product Development at CAMUG, YYC Nov 2014
Thoughts on Lean Product Development at CAMUG, YYC Nov 2014
 
Shubhamangala_ST_3+yrs_Testing
Shubhamangala_ST_3+yrs_TestingShubhamangala_ST_3+yrs_Testing
Shubhamangala_ST_3+yrs_Testing
 
Software Testing Tutorial For Beginners | Manual & Automation Testing | Selen...
Software Testing Tutorial For Beginners | Manual & Automation Testing | Selen...Software Testing Tutorial For Beginners | Manual & Automation Testing | Selen...
Software Testing Tutorial For Beginners | Manual & Automation Testing | Selen...
 
Quality Assurance & Testing in a glimpse
Quality Assurance & Testing in a glimpseQuality Assurance & Testing in a glimpse
Quality Assurance & Testing in a glimpse
 
QA part 2
QA part 2QA part 2
QA part 2
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Spring AOP
Spring AOPSpring AOP
Spring AOP
 

More from Roberto Bettazzoni

The mythical technical debt. (Brooks, please, forgive me)
The mythical technical debt. (Brooks, please, forgive me)The mythical technical debt. (Brooks, please, forgive me)
The mythical technical debt. (Brooks, please, forgive me)
Roberto Bettazzoni
 
Giornat Mondiale della Retrospettiva 2020 - Riassunto Meetup Remoto
Giornat Mondiale della Retrospettiva 2020 - Riassunto Meetup RemotoGiornat Mondiale della Retrospettiva 2020 - Riassunto Meetup Remoto
Giornat Mondiale della Retrospettiva 2020 - Riassunto Meetup Remoto
Roberto Bettazzoni
 
Complexity indicators: estimation precision and test types
Complexity indicators: estimation precision and test typesComplexity indicators: estimation precision and test types
Complexity indicators: estimation precision and test types
Roberto Bettazzoni
 
Why you need to change your way of working
Why you need to change your way of workingWhy you need to change your way of working
Why you need to change your way of working
Roberto Bettazzoni
 
Presentation TDD in Python
Presentation TDD in PythonPresentation TDD in Python
Presentation TDD in Python
Roberto Bettazzoni
 
Cynefin Lego Game Agenda (versione 2.0 in Italiano)
Cynefin Lego Game Agenda (versione 2.0 in Italiano) Cynefin Lego Game Agenda (versione 2.0 in Italiano)
Cynefin Lego Game Agenda (versione 2.0 in Italiano)
Roberto Bettazzoni
 
Pair programming and pair training
Pair programming and pair trainingPair programming and pair training
Pair programming and pair training
Roberto Bettazzoni
 
Presentazione eXtreme Programming
Presentazione eXtreme ProgrammingPresentazione eXtreme Programming
Presentazione eXtreme Programming
Roberto Bettazzoni
 
Agile e Open Source
Agile e Open SourceAgile e Open Source
Agile e Open Source
Roberto Bettazzoni
 
Esempio di code kata
Esempio di code kataEsempio di code kata
Esempio di code kata
Roberto Bettazzoni
 
Introduzione alle metodologie e pratiche Agili ... ma l'agile c'entra qualcos...
Introduzione alle metodologie e pratiche Agili ... ma l'agile c'entra qualcos...Introduzione alle metodologie e pratiche Agili ... ma l'agile c'entra qualcos...
Introduzione alle metodologie e pratiche Agili ... ma l'agile c'entra qualcos...
Roberto Bettazzoni
 
Una fugace occhiata al Test Driven Development (2006)
Una fugace occhiata al Test Driven Development  (2006)Una fugace occhiata al Test Driven Development  (2006)
Una fugace occhiata al Test Driven Development (2006)
Roberto Bettazzoni
 
The BDD live show (ITA)
The BDD live show (ITA)The BDD live show (ITA)
The BDD live show (ITA)
Roberto Bettazzoni
 
Programmazione android per esseri umani
Programmazione android per esseri umaniProgrammazione android per esseri umani
Programmazione android per esseri umani
Roberto Bettazzoni
 

More from Roberto Bettazzoni (14)

The mythical technical debt. (Brooks, please, forgive me)
The mythical technical debt. (Brooks, please, forgive me)The mythical technical debt. (Brooks, please, forgive me)
The mythical technical debt. (Brooks, please, forgive me)
 
Giornat Mondiale della Retrospettiva 2020 - Riassunto Meetup Remoto
Giornat Mondiale della Retrospettiva 2020 - Riassunto Meetup RemotoGiornat Mondiale della Retrospettiva 2020 - Riassunto Meetup Remoto
Giornat Mondiale della Retrospettiva 2020 - Riassunto Meetup Remoto
 
Complexity indicators: estimation precision and test types
Complexity indicators: estimation precision and test typesComplexity indicators: estimation precision and test types
Complexity indicators: estimation precision and test types
 
Why you need to change your way of working
Why you need to change your way of workingWhy you need to change your way of working
Why you need to change your way of working
 
Presentation TDD in Python
Presentation TDD in PythonPresentation TDD in Python
Presentation TDD in Python
 
Cynefin Lego Game Agenda (versione 2.0 in Italiano)
Cynefin Lego Game Agenda (versione 2.0 in Italiano) Cynefin Lego Game Agenda (versione 2.0 in Italiano)
Cynefin Lego Game Agenda (versione 2.0 in Italiano)
 
Pair programming and pair training
Pair programming and pair trainingPair programming and pair training
Pair programming and pair training
 
Presentazione eXtreme Programming
Presentazione eXtreme ProgrammingPresentazione eXtreme Programming
Presentazione eXtreme Programming
 
Agile e Open Source
Agile e Open SourceAgile e Open Source
Agile e Open Source
 
Esempio di code kata
Esempio di code kataEsempio di code kata
Esempio di code kata
 
Introduzione alle metodologie e pratiche Agili ... ma l'agile c'entra qualcos...
Introduzione alle metodologie e pratiche Agili ... ma l'agile c'entra qualcos...Introduzione alle metodologie e pratiche Agili ... ma l'agile c'entra qualcos...
Introduzione alle metodologie e pratiche Agili ... ma l'agile c'entra qualcos...
 
Una fugace occhiata al Test Driven Development (2006)
Una fugace occhiata al Test Driven Development  (2006)Una fugace occhiata al Test Driven Development  (2006)
Una fugace occhiata al Test Driven Development (2006)
 
The BDD live show (ITA)
The BDD live show (ITA)The BDD live show (ITA)
The BDD live show (ITA)
 
Programmazione android per esseri umani
Programmazione android per esseri umaniProgrammazione android per esseri umani
Programmazione android per esseri umani
 

Recently uploaded

Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
ThousandEyes
 
Discover the Power of ONEMONITAR: The Ultimate Mobile Spy App for Android Dev...
Discover the Power of ONEMONITAR: The Ultimate Mobile Spy App for Android Dev...Discover the Power of ONEMONITAR: The Ultimate Mobile Spy App for Android Dev...
Discover the Power of ONEMONITAR: The Ultimate Mobile Spy App for Android Dev...
onemonitarsoftware
 
Unleashing the Future: Building a Scalable and Up-to-Date GenAI Chatbot with ...
Unleashing the Future: Building a Scalable and Up-to-Date GenAI Chatbot with ...Unleashing the Future: Building a Scalable and Up-to-Date GenAI Chatbot with ...
Unleashing the Future: Building a Scalable and Up-to-Date GenAI Chatbot with ...
confluent
 
Splunk_Remote_Work_Insights_Overview.pptx
Splunk_Remote_Work_Insights_Overview.pptxSplunk_Remote_Work_Insights_Overview.pptx
Splunk_Remote_Work_Insights_Overview.pptx
sudsdeep
 
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) Course Introducti...
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) Course Introducti...AWS Cloud Practitioner Essentials (Second Edition) (Arabic) Course Introducti...
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) Course Introducti...
karim wahed
 
ThaiPy meetup - Indexes and Django
ThaiPy meetup - Indexes and DjangoThaiPy meetup - Indexes and Django
ThaiPy meetup - Indexes and Django
akshesh doshi
 
What is OCR Technology and How to Extract Text from Any Image for Free
What is OCR Technology and How to Extract Text from Any Image for FreeWhat is OCR Technology and How to Extract Text from Any Image for Free
What is OCR Technology and How to Extract Text from Any Image for Free
TwisterTools
 
AWS DevOps-Tutorial CHANAKYA SRIYAN DUKKA.
AWS DevOps-Tutorial CHANAKYA SRIYAN DUKKA.AWS DevOps-Tutorial CHANAKYA SRIYAN DUKKA.
AWS DevOps-Tutorial CHANAKYA SRIYAN DUKKA.
Srinivas Dukka
 
Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.
shivamt017
 
Attendance Tracking From Paper To Digital
Attendance Tracking From Paper To DigitalAttendance Tracking From Paper To Digital
Attendance Tracking From Paper To Digital
Task Tracker
 
Folding Cheat Sheet #7 - seventh in a series
Folding Cheat Sheet #7 - seventh in a seriesFolding Cheat Sheet #7 - seventh in a series
Folding Cheat Sheet #7 - seventh in a series
Philip Schwarz
 
當測試開始左移
當測試開始左移當測試開始左移
當測試開始左移
Jersey (CHE-PING) Su
 
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) .pdf
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) .pdfAWS Cloud Practitioner Essentials (Second Edition) (Arabic) .pdf
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) .pdf
karim wahed
 
Leading Project Management Tool Taskruop.pptx
Leading Project Management Tool Taskruop.pptxLeading Project Management Tool Taskruop.pptx
Leading Project Management Tool Taskruop.pptx
taskroupseo
 
Vip Girls Call ServiCe Hyderabad 0000000000 Pooja Best High Class Hyderabad A...
Vip Girls Call ServiCe Hyderabad 0000000000 Pooja Best High Class Hyderabad A...Vip Girls Call ServiCe Hyderabad 0000000000 Pooja Best High Class Hyderabad A...
Vip Girls Call ServiCe Hyderabad 0000000000 Pooja Best High Class Hyderabad A...
ashiklo9823
 
Il Data Streaming per un’AI real-time di nuova generazione
Il Data Streaming per un’AI real-time di nuova generazioneIl Data Streaming per un’AI real-time di nuova generazione
Il Data Streaming per un’AI real-time di nuova generazione
confluent
 
Wired_2.0_Create_AmsterdamJUG_09072024.pptx
Wired_2.0_Create_AmsterdamJUG_09072024.pptxWired_2.0_Create_AmsterdamJUG_09072024.pptx
Wired_2.0_Create_AmsterdamJUG_09072024.pptx
SimonedeGijt
 
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdfWhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
onemonitarsoftware
 
welcome to presentation on Google Apps
welcome to   presentation on Google Appswelcome to   presentation on Google Apps
welcome to presentation on Google Apps
AsifKarimJim
 
Prada Group Reports Strong Growth in First Quarter …
Prada Group Reports Strong Growth in First Quarter …Prada Group Reports Strong Growth in First Quarter …
Prada Group Reports Strong Growth in First Quarter …
908dutch
 

Recently uploaded (20)

Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
Cisco Live Announcements: New ThousandEyes Release Highlights - July 2024
 
Discover the Power of ONEMONITAR: The Ultimate Mobile Spy App for Android Dev...
Discover the Power of ONEMONITAR: The Ultimate Mobile Spy App for Android Dev...Discover the Power of ONEMONITAR: The Ultimate Mobile Spy App for Android Dev...
Discover the Power of ONEMONITAR: The Ultimate Mobile Spy App for Android Dev...
 
Unleashing the Future: Building a Scalable and Up-to-Date GenAI Chatbot with ...
Unleashing the Future: Building a Scalable and Up-to-Date GenAI Chatbot with ...Unleashing the Future: Building a Scalable and Up-to-Date GenAI Chatbot with ...
Unleashing the Future: Building a Scalable and Up-to-Date GenAI Chatbot with ...
 
Splunk_Remote_Work_Insights_Overview.pptx
Splunk_Remote_Work_Insights_Overview.pptxSplunk_Remote_Work_Insights_Overview.pptx
Splunk_Remote_Work_Insights_Overview.pptx
 
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) Course Introducti...
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) Course Introducti...AWS Cloud Practitioner Essentials (Second Edition) (Arabic) Course Introducti...
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) Course Introducti...
 
ThaiPy meetup - Indexes and Django
ThaiPy meetup - Indexes and DjangoThaiPy meetup - Indexes and Django
ThaiPy meetup - Indexes and Django
 
What is OCR Technology and How to Extract Text from Any Image for Free
What is OCR Technology and How to Extract Text from Any Image for FreeWhat is OCR Technology and How to Extract Text from Any Image for Free
What is OCR Technology and How to Extract Text from Any Image for Free
 
AWS DevOps-Tutorial CHANAKYA SRIYAN DUKKA.
AWS DevOps-Tutorial CHANAKYA SRIYAN DUKKA.AWS DevOps-Tutorial CHANAKYA SRIYAN DUKKA.
AWS DevOps-Tutorial CHANAKYA SRIYAN DUKKA.
 
Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.Shivam Pandit working on Php Web Developer.
Shivam Pandit working on Php Web Developer.
 
Attendance Tracking From Paper To Digital
Attendance Tracking From Paper To DigitalAttendance Tracking From Paper To Digital
Attendance Tracking From Paper To Digital
 
Folding Cheat Sheet #7 - seventh in a series
Folding Cheat Sheet #7 - seventh in a seriesFolding Cheat Sheet #7 - seventh in a series
Folding Cheat Sheet #7 - seventh in a series
 
當測試開始左移
當測試開始左移當測試開始左移
當測試開始左移
 
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) .pdf
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) .pdfAWS Cloud Practitioner Essentials (Second Edition) (Arabic) .pdf
AWS Cloud Practitioner Essentials (Second Edition) (Arabic) .pdf
 
Leading Project Management Tool Taskruop.pptx
Leading Project Management Tool Taskruop.pptxLeading Project Management Tool Taskruop.pptx
Leading Project Management Tool Taskruop.pptx
 
Vip Girls Call ServiCe Hyderabad 0000000000 Pooja Best High Class Hyderabad A...
Vip Girls Call ServiCe Hyderabad 0000000000 Pooja Best High Class Hyderabad A...Vip Girls Call ServiCe Hyderabad 0000000000 Pooja Best High Class Hyderabad A...
Vip Girls Call ServiCe Hyderabad 0000000000 Pooja Best High Class Hyderabad A...
 
Il Data Streaming per un’AI real-time di nuova generazione
Il Data Streaming per un’AI real-time di nuova generazioneIl Data Streaming per un’AI real-time di nuova generazione
Il Data Streaming per un’AI real-time di nuova generazione
 
Wired_2.0_Create_AmsterdamJUG_09072024.pptx
Wired_2.0_Create_AmsterdamJUG_09072024.pptxWired_2.0_Create_AmsterdamJUG_09072024.pptx
Wired_2.0_Create_AmsterdamJUG_09072024.pptx
 
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdfWhatsApp Tracker -  Tracking WhatsApp to Boost Online Safety.pdf
WhatsApp Tracker - Tracking WhatsApp to Boost Online Safety.pdf
 
welcome to presentation on Google Apps
welcome to   presentation on Google Appswelcome to   presentation on Google Apps
welcome to presentation on Google Apps
 
Prada Group Reports Strong Growth in First Quarter …
Prada Group Reports Strong Growth in First Quarter …Prada Group Reports Strong Growth in First Quarter …
Prada Group Reports Strong Growth in First Quarter …
 

Unit test in a nutshell

  • 1. Unit Test in a nutshell Short presentation of a method to verify isolated units of code agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  • 2. About me Roberto Bettazzoni Agile Coach eXtreme Programming Trainer ! Certified Scrum Professional >30 years of coding (and still proudly counting) ! roberto.bettazzoni@agile42.com linkedin.com/in/robertobettazzoni @bettazzoni agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  • 3. unit test Method to verify isolated units of code agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  • 4. unit test user code Acceptance Criteria test Functional test Unit test Unit tests are written by coders for coders to test the code design agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  • 5. unit test Method to verify isolated units of code agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  • 6. unit test Method to verify isolated units of code agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  • 7. unit test assert( condition ) agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  • 8. unit test library assert( bool condition ) assertEqual( <T> a, <T> b ) assertEqual( float a, float b, float precision) assertThrow( exceptionType, function) agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  • 9. unit test Method to verify isolated units of code agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  • 10. Test Isolation A B C D agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  • 11. Test Isolation Run 4 tests: A, B, C, D A B C D agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  • 12. Test Isolation A B C D agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  • 13. Test Isolation Run 3 tests: A, B, D A B D agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  • 14. Test Isolation Run 3 tests: D, A, B D A B agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  • 15. unit test library test() agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  • 16. unit test library setup() - test() - teardown() agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  • 17. unit test library Test Class also known as TestCase or TestFixture { setup() {} teardown() {} ! test_method_1() test_method_2() test_method_3() } agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  • 18. unit test library Test Class also known as TestCase or TestFixture setup() - test_method_1() - teardown() setup() - test_method_2() - teardown() setup() - test_method_3() - teardown() agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  • 19. unit test Method to verify isolated units of code agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  • 20. unit test - What is a unit of code? Classes Methods Functions Blocks of code agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  • 21. Code Isolation (or Unit Isolation) A B C D agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  • 22. Code Isolation (or Unit Isolation) A B C D agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  • 23. Take a guess What makes a “good unit test”? agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  • 24. Take a guess What makes a “good unit test”? Readability agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
  • 25. Food for thoughts agile42 | We advise, train and coach companies building software | www.agile42.com | Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License