SlideShare a Scribd company logo
1 of 28
Download to read offline
TDD distilled... in Java
Notes
● Shared slides are without images because of intellectual rights reasons.
● In conference slides you found images from “The Colour Monster” thanks to Anna
Llenas and Flamboyant Editions
○ http://www.annallenas.com
● Manuela Munaretto
● Agile Dev at Xpeppers
● Mother
● @m_munaretto
● www.xpeppers.com
● manuela.munaretto@xpeppers.
com
● Ivan Lombardi Borgia
● Agile Dev at Xpeppers
● @ivanlombardib
● www.xpeppers.com
● ivan.lombardiborgia@xpeppers.
com
Who are we?
● Sharing is growing
● Give back to the community
Why we are here?
Agenda
25’: Welcome and introduction to codelab
5’: Q&A
25’: Session #1
10’: Retrospective
25’: Session #2
20’: Retrospective
5’: Feedback door
Distilled
The What and The Why
● The What: the mechanics
● The Why: the ideas behind them
The What
What I mean by TDD
RED
GREEN REFACTOR
The TDD mantra
● RED
● GREEN
● REFACTOR
Add a little failing test
You are not allowed to write any production code unless it is to
make a failing unit test pass.
Run all tests and fail
You are not allowed to write any more of a unit test than is
sufficient to fail.
Make a little change
You are not allowed to write any more production code than is
sufficient to pass the one failing unit test.
Run the tests and succeed
If it succeeds, you’re done.
Refactor to name concepts
Explicitly name the concepts before you try to eliminate the
duplication.
Refactor to remove duplication
Don’t Repeat Yourself: every piece of knowledge must have a
single, unambiguous, authoritative representation within a
system.
Write a test list
● A title
● Get things out of your head quickly
● Any example that comes to mind
● Simpler examples
● All the variations
What TDD is not
● Traditional Unit Testing
○ After the program has been
written
○ Try to find problem
● A testing technique
○ Unit Testing
○ Stress Testing
○ Smoke Testing
○ Black box Testing
The Why
RED
● It forces you to really think about what you are going to do.
● There is a big step between hearing the words of a customer
and understanding the meaning.
● It drives the design.
GREEN
● Divide et impera.
● Fake it until make it.
● Don't try to implement two things at a time.
● Writing the easy code first makes writing the hard code easy.
REFACTOR
● Make it Clean preserving functionalities.
● Keep work focused.
● Permit more aggressive refactorings.
● Complexity on tests reflect complexity on production code.
The Code
String Calculator
● Simple exercise to focus on basis
● Also experts need to practice basis
https://github.com/xpeppers/tdd-distilled-java
The Feedback
Retrospective
● What I learned
○ +
○ -
● Actions
● You should not go through the door
without giving some feedback:
○ A scale 1 to 5
○ 1 = very negative
○ 5 = very positive
Resources
● Extreme Programming: A gentle introduction
○ http://www.extremeprogramming.org/
● Test-Driven Development: By Example - Kent Beck
○ http://www.amazon.
it/dp/0321146530/ref=cm_sw_r_tw_dp_5rgrwb1F002NJ
● Cunningham & Cunningham, Inc.
○ http://c2.com/
Resources
● The World's Best Intro to TDD
○ http://online-training.jbrains.ca/courses/wbitdd-01
● String Calculator
○ http://osherove.com/tdd-kata-1/
● Understanding the 4 rules of simple design
○ https://leanpub.com/4rulesofsimpledesign
Resources
● Workflows Of Refactoring
○ http://martinfowler.com/articles/workflowsOfRefactoring
● The Feedback Door
○ https://dzone.com/articles/feedback-door

More Related Content

What's hot

What's hot (8)

Building and Managing a Digital English Studio
Building and Managing a Digital English StudioBuilding and Managing a Digital English Studio
Building and Managing a Digital English Studio
 
Post-Agile Methodologies and all that Jazz
Post-Agile Methodologies and all that JazzPost-Agile Methodologies and all that Jazz
Post-Agile Methodologies and all that Jazz
 
Philippe Lewicki (AfterNow): User Experience for Practical Applications in Mi...
Philippe Lewicki (AfterNow): User Experience for Practical Applications in Mi...Philippe Lewicki (AfterNow): User Experience for Practical Applications in Mi...
Philippe Lewicki (AfterNow): User Experience for Practical Applications in Mi...
 
Turning humans into developers with Perl - London Perl Workshop 2017
Turning humans into developers with Perl - London Perl Workshop 2017Turning humans into developers with Perl - London Perl Workshop 2017
Turning humans into developers with Perl - London Perl Workshop 2017
 
Agile Programming Live - AgilePrague2012
Agile Programming Live - AgilePrague2012Agile Programming Live - AgilePrague2012
Agile Programming Live - AgilePrague2012
 
Be your own boss - An intro to freelancing
Be your own boss - An intro to freelancingBe your own boss - An intro to freelancing
Be your own boss - An intro to freelancing
 
Some of my best friends are localisers
Some of my best friends are localisersSome of my best friends are localisers
Some of my best friends are localisers
 
Microsoft at NFB
Microsoft at NFBMicrosoft at NFB
Microsoft at NFB
 

Similar to Tdd distilled... in java

Xconf 2014 - Contributing to Open Source
Xconf 2014 - Contributing to Open SourceXconf 2014 - Contributing to Open Source
Xconf 2014 - Contributing to Open Source
Paras Narang
 
Collaborating with Developers: How-to Guide for Test Engineers - By Gil Tayar
Collaborating with Developers: How-to Guide for Test Engineers - By Gil Tayar Collaborating with Developers: How-to Guide for Test Engineers - By Gil Tayar
Collaborating with Developers: How-to Guide for Test Engineers - By Gil Tayar
Applitools
 

Similar to Tdd distilled... in java (20)

Coding dojo
Coding dojoCoding dojo
Coding dojo
 
The obstacles of developer productivity.pptx
The obstacles of developer productivity.pptxThe obstacles of developer productivity.pptx
The obstacles of developer productivity.pptx
 
Test driven development_and_puppet-cfgmgmtcamp_eu-20140402
Test driven development_and_puppet-cfgmgmtcamp_eu-20140402Test driven development_and_puppet-cfgmgmtcamp_eu-20140402
Test driven development_and_puppet-cfgmgmtcamp_eu-20140402
 
Xconf 2014 - Contributing to Open Source
Xconf 2014 - Contributing to Open SourceXconf 2014 - Contributing to Open Source
Xconf 2014 - Contributing to Open Source
 
Ace the Tech Interviews - www.hiredintech.com
Ace the Tech Interviews - www.hiredintech.comAce the Tech Interviews - www.hiredintech.com
Ace the Tech Interviews - www.hiredintech.com
 
Professional development
Professional developmentProfessional development
Professional development
 
Pair programming
Pair programmingPair programming
Pair programming
 
Simple vs Easy
Simple vs EasySimple vs Easy
Simple vs Easy
 
Collaborating with Developers: How-to Guide for Test Engineers - By Gil Tayar
Collaborating with Developers: How-to Guide for Test Engineers - By Gil Tayar Collaborating with Developers: How-to Guide for Test Engineers - By Gil Tayar
Collaborating with Developers: How-to Guide for Test Engineers - By Gil Tayar
 
Design of everyday things fundamental principles of interaction
Design of everyday things   fundamental principles of interactionDesign of everyday things   fundamental principles of interaction
Design of everyday things fundamental principles of interaction
 
CP vs Project - Elevate Ep. 02.pdf
CP vs Project  - Elevate Ep. 02.pdfCP vs Project  - Elevate Ep. 02.pdf
CP vs Project - Elevate Ep. 02.pdf
 
Exploring design-alternatives-using-tdd
Exploring design-alternatives-using-tddExploring design-alternatives-using-tdd
Exploring design-alternatives-using-tdd
 
How to be a 10x Engineer
How to be a 10x EngineerHow to be a 10x Engineer
How to be a 10x Engineer
 
Writing Tests Effectively
Writing Tests EffectivelyWriting Tests Effectively
Writing Tests Effectively
 
The Holistic Programmer
The Holistic ProgrammerThe Holistic Programmer
The Holistic Programmer
 
Public presentations for software engineers
Public presentations for software engineersPublic presentations for software engineers
Public presentations for software engineers
 
How to run a hackday
How to run a hackdayHow to run a hackday
How to run a hackday
 
Engineer - Mastering the Art of Software
Engineer - Mastering the Art of SoftwareEngineer - Mastering the Art of Software
Engineer - Mastering the Art of Software
 
Test driven development - why you should test first?
Test driven development - why you should test first?Test driven development - why you should test first?
Test driven development - why you should test first?
 
Habits of scalable product organizations
Habits of scalable product organizationsHabits of scalable product organizations
Habits of scalable product organizations
 

Recently uploaded

Recently uploaded (20)

Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
Anypoint Code Builder - Munich MuleSoft Meetup - 16th May 2024
 
From Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST APIFrom Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST API
 
^Clinic ^%[+27788225528*Abortion Pills For Sale In birch acres
^Clinic ^%[+27788225528*Abortion Pills For Sale In birch acres^Clinic ^%[+27788225528*Abortion Pills For Sale In birch acres
^Clinic ^%[+27788225528*Abortion Pills For Sale In birch acres
 
Effective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeConEffective Strategies for Wix's Scaling challenges - GeeCon
Effective Strategies for Wix's Scaling challenges - GeeCon
 
Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024Secure Software Ecosystem Teqnation 2024
Secure Software Ecosystem Teqnation 2024
 
Evolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI EraEvolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI Era
 
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
COMPUTER AND ITS COMPONENTS PPT.by naitik sharma Class 9th A mittal internati...
 
Software Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringSoftware Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements Engineering
 
Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?
 
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024Automate your OpenSIPS config tests - OpenSIPS Summit 2024
Automate your OpenSIPS config tests - OpenSIPS Summit 2024
 
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
Auto Affiliate  AI Earns First Commission in 3 Hours..pdfAuto Affiliate  AI Earns First Commission in 3 Hours..pdf
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
 
Abortion Clinic In Springs ](+27832195400*)[ 🏥 Safe Abortion Pills in Springs...
Abortion Clinic In Springs ](+27832195400*)[ 🏥 Safe Abortion Pills in Springs...Abortion Clinic In Springs ](+27832195400*)[ 🏥 Safe Abortion Pills in Springs...
Abortion Clinic In Springs ](+27832195400*)[ 🏥 Safe Abortion Pills in Springs...
 
What is a Recruitment Management Software?
What is a Recruitment Management Software?What is a Recruitment Management Software?
What is a Recruitment Management Software?
 
Sinoville Clinic ](+27832195400*)[🏥Abortion Pill Prices Sinoville ● Women's A...
Sinoville Clinic ](+27832195400*)[🏥Abortion Pill Prices Sinoville ● Women's A...Sinoville Clinic ](+27832195400*)[🏥Abortion Pill Prices Sinoville ● Women's A...
Sinoville Clinic ](+27832195400*)[🏥Abortion Pill Prices Sinoville ● Women's A...
 
architecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdfarchitecting-ai-in-the-enterprise-apis-and-applications.pdf
architecting-ai-in-the-enterprise-apis-and-applications.pdf
 
Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...
Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...
Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...
 
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanWorkshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
 
Transformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with LinksTransformer Neural Network Use Cases with Links
Transformer Neural Network Use Cases with Links
 
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
Abortion Clinic In Johannesburg ](+27832195400*)[ 🏥 Safe Abortion Pills in Jo...
 
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
Entropy, Software Quality, and Innovation (presented at Princeton Plasma Phys...
 

Tdd distilled... in java

  • 2. Notes ● Shared slides are without images because of intellectual rights reasons. ● In conference slides you found images from “The Colour Monster” thanks to Anna Llenas and Flamboyant Editions ○ http://www.annallenas.com
  • 3. ● Manuela Munaretto ● Agile Dev at Xpeppers ● Mother ● @m_munaretto ● www.xpeppers.com ● manuela.munaretto@xpeppers. com ● Ivan Lombardi Borgia ● Agile Dev at Xpeppers ● @ivanlombardib ● www.xpeppers.com ● ivan.lombardiborgia@xpeppers. com Who are we?
  • 4. ● Sharing is growing ● Give back to the community Why we are here?
  • 5. Agenda 25’: Welcome and introduction to codelab 5’: Q&A 25’: Session #1 10’: Retrospective 25’: Session #2 20’: Retrospective 5’: Feedback door
  • 7. The What and The Why ● The What: the mechanics ● The Why: the ideas behind them
  • 9. What I mean by TDD RED GREEN REFACTOR The TDD mantra ● RED ● GREEN ● REFACTOR
  • 10. Add a little failing test You are not allowed to write any production code unless it is to make a failing unit test pass.
  • 11. Run all tests and fail You are not allowed to write any more of a unit test than is sufficient to fail.
  • 12. Make a little change You are not allowed to write any more production code than is sufficient to pass the one failing unit test.
  • 13. Run the tests and succeed If it succeeds, you’re done.
  • 14. Refactor to name concepts Explicitly name the concepts before you try to eliminate the duplication.
  • 15. Refactor to remove duplication Don’t Repeat Yourself: every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
  • 16. Write a test list ● A title ● Get things out of your head quickly ● Any example that comes to mind ● Simpler examples ● All the variations
  • 17. What TDD is not ● Traditional Unit Testing ○ After the program has been written ○ Try to find problem ● A testing technique ○ Unit Testing ○ Stress Testing ○ Smoke Testing ○ Black box Testing
  • 19. RED ● It forces you to really think about what you are going to do. ● There is a big step between hearing the words of a customer and understanding the meaning. ● It drives the design.
  • 20. GREEN ● Divide et impera. ● Fake it until make it. ● Don't try to implement two things at a time. ● Writing the easy code first makes writing the hard code easy.
  • 21. REFACTOR ● Make it Clean preserving functionalities. ● Keep work focused. ● Permit more aggressive refactorings. ● Complexity on tests reflect complexity on production code.
  • 23. String Calculator ● Simple exercise to focus on basis ● Also experts need to practice basis https://github.com/xpeppers/tdd-distilled-java
  • 25. Retrospective ● What I learned ○ + ○ - ● Actions ● You should not go through the door without giving some feedback: ○ A scale 1 to 5 ○ 1 = very negative ○ 5 = very positive
  • 26. Resources ● Extreme Programming: A gentle introduction ○ http://www.extremeprogramming.org/ ● Test-Driven Development: By Example - Kent Beck ○ http://www.amazon. it/dp/0321146530/ref=cm_sw_r_tw_dp_5rgrwb1F002NJ ● Cunningham & Cunningham, Inc. ○ http://c2.com/
  • 27. Resources ● The World's Best Intro to TDD ○ http://online-training.jbrains.ca/courses/wbitdd-01 ● String Calculator ○ http://osherove.com/tdd-kata-1/ ● Understanding the 4 rules of simple design ○ https://leanpub.com/4rulesofsimpledesign
  • 28. Resources ● Workflows Of Refactoring ○ http://martinfowler.com/articles/workflowsOfRefactoring ● The Feedback Door ○ https://dzone.com/articles/feedback-door