SlideShare a Scribd company logo
Test Driven Development
with JUnit and Fittness
Lukas Rypl
TTC MARCONI
Czech Republic
Twitter: @LukasRypl
for BarCamp Saigon
9/9/2012
Target Audience
Java developers
Programmers in any other language
Their team leaders
Testers
Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 2 / 10
Target Audience
Java developers
Programmers in any other language
Their team leaders
Testers
Profesionals who
feel safer
sleep better
validate their work
Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 2 / 10
Agenda
Intro - what and why
Simple project with JUnit
Adding Fitness
Advanced topics
Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 3 / 10
Our simple project
Everybody is talking about BarCamp.
Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 4 / 10
Our simple project
Everybody is talking about BarCamp.
Bar Camp Saigon
barcamp
BarCamp Saigon 2012
#barcampsaigon
. . .
Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 4 / 10
Our simple project
Everybody is talking about BarCamp.
Bar Camp Saigon
barcamp
BarCamp Saigon 2012
#barcampsaigon
. . .
Task: is it a valid name?
Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 4 / 10
Developers Work Algorithm
Test Driven Development
while (task.requiresWork())
{
1. Write a failing unit test
2. Write implementation
}
Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 5 / 10
Why Unit Testing
make sure that foundations are OK
create better (extensible) design
think about edge cases
Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 6 / 10
Tools
Eclipse (IDE) www.eclipse.org
JUnit (unit testing library) www.junit.org
Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 7 / 10
Tools
Eclipse (IDE) www.eclipse.org
JUnit (unit testing library) www.junit.org
Fitness www.fitnesse.org
Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 7 / 10
Time to play
JUnit
Fitness
Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 8 / 10
Time to play
JUnit
Fitness
Why another tool?
acessibe to non-programers
examples can be created during analysis
may overlap with junit / preventing
duplication?
Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 8 / 10
Unit Testing Books
Kent Beck:
Test Driven Development by Example (2002)
Martin Fowler:
Refactoring: Improving the Design of Existing
Code (1999)
Michael E. Faethers:
Working Effectively with Legacy Code (2004)
Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 9 / 10
Advanced Topics
dealing with dependencies (mocks, stubs)
Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 10 / 10
Advanced Topics
dealing with dependencies (mocks, stubs)
running tests automatically
Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 10 / 10
Advanced Topics
dealing with dependencies (mocks, stubs)
running tests automatically
acceptance tests driven development (ATDD),
specification by example (cucumber)
Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 10 / 10
Advanced Topics
dealing with dependencies (mocks, stubs)
running tests automatically
acceptance tests driven development (ATDD),
specification by example (cucumber)
when unit tests do not pay off?
Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 10 / 10

More Related Content

Viewers also liked

Sweat Equity Network
Sweat Equity NetworkSweat Equity Network
Sweat Equity Network
LEAP4LIFE
 
Revenue models / The IX online revenue models / Gbgalexandria
Revenue models / The IX online revenue models / GbgalexandriaRevenue models / The IX online revenue models / Gbgalexandria
Revenue models / The IX online revenue models / GbgalexandriaMohamed Rady
 
LEAP4LIFE GREAT RACE Eco Challenge 2012
LEAP4LIFE GREAT RACE Eco Challenge 2012LEAP4LIFE GREAT RACE Eco Challenge 2012
LEAP4LIFE GREAT RACE Eco Challenge 2012
LEAP4LIFE
 
Farode chipiona
Farode chipionaFarode chipiona
Farode chipionapp2mara
 
Качественный видео контент - где его брать
Качественный видео контент - где его братьКачественный видео контент - где его брать
Качественный видео контент - где его брать
Ян Голубь
 
How to Win Elections
How to Win ElectionsHow to Win Elections
How to Win Elections
excela
 
World war 2 ABC Book
World war 2 ABC BookWorld war 2 ABC Book
World war 2 ABC Book
skylar345
 
A Glossary of Commonly Used Billiards Terms: M through Z, by Christopher Lozak
A Glossary of Commonly Used Billiards Terms: M through Z, by Christopher LozakA Glossary of Commonly Used Billiards Terms: M through Z, by Christopher Lozak
A Glossary of Commonly Used Billiards Terms: M through Z, by Christopher LozakChristopher Lozak
 
Ablactacion & nutricion preescolar
Ablactacion & nutricion preescolarAblactacion & nutricion preescolar
Ablactacion & nutricion preescolar
Sergio Aguilar
 
Adrp2007facultyendowmentstewardship1 1233017946088600-1
Adrp2007facultyendowmentstewardship1 1233017946088600-1Adrp2007facultyendowmentstewardship1 1233017946088600-1
Adrp2007facultyendowmentstewardship1 1233017946088600-1KathrynHart
 
Asma
AsmaAsma
Overcoming The Dark Side Of Leadership
Overcoming The Dark Side Of LeadershipOvercoming The Dark Side Of Leadership
Overcoming The Dark Side Of LeadershipRobb Farrell
 
surf excel
 surf excel surf excel
surf excel
Naman Vijayvargiya
 
Manejo y almacenamiento de Alimentos
Manejo y almacenamiento de AlimentosManejo y almacenamiento de Alimentos
Manejo y almacenamiento de Alimentos
domicfp
 

Viewers also liked (16)

Sweat Equity Network
Sweat Equity NetworkSweat Equity Network
Sweat Equity Network
 
Revenue models / The IX online revenue models / Gbgalexandria
Revenue models / The IX online revenue models / GbgalexandriaRevenue models / The IX online revenue models / Gbgalexandria
Revenue models / The IX online revenue models / Gbgalexandria
 
LEAP4LIFE GREAT RACE Eco Challenge 2012
LEAP4LIFE GREAT RACE Eco Challenge 2012LEAP4LIFE GREAT RACE Eco Challenge 2012
LEAP4LIFE GREAT RACE Eco Challenge 2012
 
Farode chipiona
Farode chipionaFarode chipiona
Farode chipiona
 
Качественный видео контент - где его брать
Качественный видео контент - где его братьКачественный видео контент - где его брать
Качественный видео контент - где его брать
 
How to Win Elections
How to Win ElectionsHow to Win Elections
How to Win Elections
 
Telecomunicaciones
TelecomunicacionesTelecomunicaciones
Telecomunicaciones
 
World war 2 ABC Book
World war 2 ABC BookWorld war 2 ABC Book
World war 2 ABC Book
 
A Glossary of Commonly Used Billiards Terms: M through Z, by Christopher Lozak
A Glossary of Commonly Used Billiards Terms: M through Z, by Christopher LozakA Glossary of Commonly Used Billiards Terms: M through Z, by Christopher Lozak
A Glossary of Commonly Used Billiards Terms: M through Z, by Christopher Lozak
 
Ablactacion & nutricion preescolar
Ablactacion & nutricion preescolarAblactacion & nutricion preescolar
Ablactacion & nutricion preescolar
 
TARDEC Presentation 2
TARDEC Presentation 2TARDEC Presentation 2
TARDEC Presentation 2
 
Adrp2007facultyendowmentstewardship1 1233017946088600-1
Adrp2007facultyendowmentstewardship1 1233017946088600-1Adrp2007facultyendowmentstewardship1 1233017946088600-1
Adrp2007facultyendowmentstewardship1 1233017946088600-1
 
Asma
AsmaAsma
Asma
 
Overcoming The Dark Side Of Leadership
Overcoming The Dark Side Of LeadershipOvercoming The Dark Side Of Leadership
Overcoming The Dark Side Of Leadership
 
surf excel
 surf excel surf excel
surf excel
 
Manejo y almacenamiento de Alimentos
Manejo y almacenamiento de AlimentosManejo y almacenamiento de Alimentos
Manejo y almacenamiento de Alimentos
 

Similar to Bar campsaigon2012 j-unitfitness

What the hype
What the hypeWhat the hype
What the hype
Željko Plesac
 
"How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie...
"How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie..."How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie...
"How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie...
Fwdays
 
SAP Inside Track Munich 2018 - DevOps and Deployment Pipelines in ABAP Landsc...
SAP Inside Track Munich 2018 - DevOps and Deployment Pipelines in ABAP Landsc...SAP Inside Track Munich 2018 - DevOps and Deployment Pipelines in ABAP Landsc...
SAP Inside Track Munich 2018 - DevOps and Deployment Pipelines in ABAP Landsc...
Sascha Junkert
 
Java 9-coding-from-zero-level-v1.0
Java 9-coding-from-zero-level-v1.0Java 9-coding-from-zero-level-v1.0
Java 9-coding-from-zero-level-v1.0
Parikshit Kumar Singh
 
Java Magazine JUNIT5 NOVEMBER/DECEMBER 2016
Java Magazine JUNIT5 NOVEMBER/DECEMBER 2016Java Magazine JUNIT5 NOVEMBER/DECEMBER 2016
Java Magazine JUNIT5 NOVEMBER/DECEMBER 2016
Erik Gur
 
Commercial Development And Sakai
Commercial Development And SakaiCommercial Development And Sakai
Commercial Development And Sakaimbanting
 
Driving development in PHP
Driving development in PHPDriving development in PHP
Driving development in PHP
Eduardo Gulias Davis
 
Android development at mercari 2015
Android development at mercari 2015Android development at mercari 2015
Android development at mercari 2015
Tomoaki Imai
 
A commercial open source project in Python
A commercial open source project in PythonA commercial open source project in Python
A commercial open source project in Python
jbrendel
 
Take A Gulp at Task Automation
Take A Gulp at Task AutomationTake A Gulp at Task Automation
Take A Gulp at Task Automation
Joel Lord
 
[Rakuten Technology Conference 2019] Be the central on your field
[Rakuten Technology Conference 2019] Be the central on your field[Rakuten Technology Conference 2019] Be the central on your field
[Rakuten Technology Conference 2019] Be the central on your field
Woohyeok Kim
 
Jetpack compose session1 (1).pptx
Jetpack compose session1 (1).pptxJetpack compose session1 (1).pptx
Jetpack compose session1 (1).pptx
ShubhamJogdand8
 
DSAG Jahreskongress 2018 - DevOps and Deployment Pipelines in SAP ABAP Landsc...
DSAG Jahreskongress 2018 - DevOps and Deployment Pipelines in SAP ABAP Landsc...DSAG Jahreskongress 2018 - DevOps and Deployment Pipelines in SAP ABAP Landsc...
DSAG Jahreskongress 2018 - DevOps and Deployment Pipelines in SAP ABAP Landsc...
Sascha Junkert
 
Phonegap presentation
Phonegap presentationPhonegap presentation
Phonegap presentation
Atilla Özgür
 
An introduction to Java 9 & Its Features
An introduction to Java 9 & Its FeaturesAn introduction to Java 9 & Its Features
An introduction to Java 9 & Its Features
NexSoftsys
 
DevOps Transformation in Microsoft – Case Study by Ognjen Bajic and Ana Roje ...
DevOps Transformation in Microsoft – Case Study by Ognjen Bajic and Ana Roje ...DevOps Transformation in Microsoft – Case Study by Ognjen Bajic and Ana Roje ...
DevOps Transformation in Microsoft – Case Study by Ognjen Bajic and Ana Roje ...
Bosnia Agile
 
PRG/215 ENTIRE CLASS UOP TUTORIALS
PRG/215 ENTIRE CLASS UOP TUTORIALSPRG/215 ENTIRE CLASS UOP TUTORIALS
PRG/215 ENTIRE CLASS UOP TUTORIALS
Sharon Reynolds
 
Protelis: Practical Aggregate Programming - Symposium on Applied Computing (S...
Protelis: Practical Aggregate Programming - Symposium on Applied Computing (S...Protelis: Practical Aggregate Programming - Symposium on Applied Computing (S...
Protelis: Practical Aggregate Programming - Symposium on Applied Computing (S...
Danilo Pianini
 
SQL v No SQL
SQL v No SQLSQL v No SQL
SQL v No SQL
Ronald Bradford
 
Android - What's new?
Android -  What's new? Android -  What's new?
Android - What's new?
Moyinoluwa Adeyemi
 

Similar to Bar campsaigon2012 j-unitfitness (20)

What the hype
What the hypeWhat the hype
What the hype
 
"How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie...
"How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie..."How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie...
"How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie...
 
SAP Inside Track Munich 2018 - DevOps and Deployment Pipelines in ABAP Landsc...
SAP Inside Track Munich 2018 - DevOps and Deployment Pipelines in ABAP Landsc...SAP Inside Track Munich 2018 - DevOps and Deployment Pipelines in ABAP Landsc...
SAP Inside Track Munich 2018 - DevOps and Deployment Pipelines in ABAP Landsc...
 
Java 9-coding-from-zero-level-v1.0
Java 9-coding-from-zero-level-v1.0Java 9-coding-from-zero-level-v1.0
Java 9-coding-from-zero-level-v1.0
 
Java Magazine JUNIT5 NOVEMBER/DECEMBER 2016
Java Magazine JUNIT5 NOVEMBER/DECEMBER 2016Java Magazine JUNIT5 NOVEMBER/DECEMBER 2016
Java Magazine JUNIT5 NOVEMBER/DECEMBER 2016
 
Commercial Development And Sakai
Commercial Development And SakaiCommercial Development And Sakai
Commercial Development And Sakai
 
Driving development in PHP
Driving development in PHPDriving development in PHP
Driving development in PHP
 
Android development at mercari 2015
Android development at mercari 2015Android development at mercari 2015
Android development at mercari 2015
 
A commercial open source project in Python
A commercial open source project in PythonA commercial open source project in Python
A commercial open source project in Python
 
Take A Gulp at Task Automation
Take A Gulp at Task AutomationTake A Gulp at Task Automation
Take A Gulp at Task Automation
 
[Rakuten Technology Conference 2019] Be the central on your field
[Rakuten Technology Conference 2019] Be the central on your field[Rakuten Technology Conference 2019] Be the central on your field
[Rakuten Technology Conference 2019] Be the central on your field
 
Jetpack compose session1 (1).pptx
Jetpack compose session1 (1).pptxJetpack compose session1 (1).pptx
Jetpack compose session1 (1).pptx
 
DSAG Jahreskongress 2018 - DevOps and Deployment Pipelines in SAP ABAP Landsc...
DSAG Jahreskongress 2018 - DevOps and Deployment Pipelines in SAP ABAP Landsc...DSAG Jahreskongress 2018 - DevOps and Deployment Pipelines in SAP ABAP Landsc...
DSAG Jahreskongress 2018 - DevOps and Deployment Pipelines in SAP ABAP Landsc...
 
Phonegap presentation
Phonegap presentationPhonegap presentation
Phonegap presentation
 
An introduction to Java 9 & Its Features
An introduction to Java 9 & Its FeaturesAn introduction to Java 9 & Its Features
An introduction to Java 9 & Its Features
 
DevOps Transformation in Microsoft – Case Study by Ognjen Bajic and Ana Roje ...
DevOps Transformation in Microsoft – Case Study by Ognjen Bajic and Ana Roje ...DevOps Transformation in Microsoft – Case Study by Ognjen Bajic and Ana Roje ...
DevOps Transformation in Microsoft – Case Study by Ognjen Bajic and Ana Roje ...
 
PRG/215 ENTIRE CLASS UOP TUTORIALS
PRG/215 ENTIRE CLASS UOP TUTORIALSPRG/215 ENTIRE CLASS UOP TUTORIALS
PRG/215 ENTIRE CLASS UOP TUTORIALS
 
Protelis: Practical Aggregate Programming - Symposium on Applied Computing (S...
Protelis: Practical Aggregate Programming - Symposium on Applied Computing (S...Protelis: Practical Aggregate Programming - Symposium on Applied Computing (S...
Protelis: Practical Aggregate Programming - Symposium on Applied Computing (S...
 
SQL v No SQL
SQL v No SQLSQL v No SQL
SQL v No SQL
 
Android - What's new?
Android -  What's new? Android -  What's new?
Android - What's new?
 

Bar campsaigon2012 j-unitfitness

  • 1. Test Driven Development with JUnit and Fittness Lukas Rypl TTC MARCONI Czech Republic Twitter: @LukasRypl for BarCamp Saigon 9/9/2012
  • 2. Target Audience Java developers Programmers in any other language Their team leaders Testers Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 2 / 10
  • 3. Target Audience Java developers Programmers in any other language Their team leaders Testers Profesionals who feel safer sleep better validate their work Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 2 / 10
  • 4. Agenda Intro - what and why Simple project with JUnit Adding Fitness Advanced topics Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 3 / 10
  • 5. Our simple project Everybody is talking about BarCamp. Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 4 / 10
  • 6. Our simple project Everybody is talking about BarCamp. Bar Camp Saigon barcamp BarCamp Saigon 2012 #barcampsaigon . . . Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 4 / 10
  • 7. Our simple project Everybody is talking about BarCamp. Bar Camp Saigon barcamp BarCamp Saigon 2012 #barcampsaigon . . . Task: is it a valid name? Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 4 / 10
  • 8. Developers Work Algorithm Test Driven Development while (task.requiresWork()) { 1. Write a failing unit test 2. Write implementation } Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 5 / 10
  • 9. Why Unit Testing make sure that foundations are OK create better (extensible) design think about edge cases Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 6 / 10
  • 10. Tools Eclipse (IDE) www.eclipse.org JUnit (unit testing library) www.junit.org Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 7 / 10
  • 11. Tools Eclipse (IDE) www.eclipse.org JUnit (unit testing library) www.junit.org Fitness www.fitnesse.org Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 7 / 10
  • 12. Time to play JUnit Fitness Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 8 / 10
  • 13. Time to play JUnit Fitness Why another tool? acessibe to non-programers examples can be created during analysis may overlap with junit / preventing duplication? Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 8 / 10
  • 14. Unit Testing Books Kent Beck: Test Driven Development by Example (2002) Martin Fowler: Refactoring: Improving the Design of Existing Code (1999) Michael E. Faethers: Working Effectively with Legacy Code (2004) Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 9 / 10
  • 15. Advanced Topics dealing with dependencies (mocks, stubs) Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 10 / 10
  • 16. Advanced Topics dealing with dependencies (mocks, stubs) running tests automatically Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 10 / 10
  • 17. Advanced Topics dealing with dependencies (mocks, stubs) running tests automatically acceptance tests driven development (ATDD), specification by example (cucumber) Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 10 / 10
  • 18. Advanced Topics dealing with dependencies (mocks, stubs) running tests automatically acceptance tests driven development (ATDD), specification by example (cucumber) when unit tests do not pay off? Lukas Rypl (BarCamp Saigon) Test Driven Development 9/9/2012 10 / 10