SlideShare a Scribd company logo
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

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
Keystone DH 2016
 
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
Stojan Peshov
 
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...
AugmentedWorldExpo
 
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
Julien Fiegehenn
 
Agile Programming Live - AgilePrague2012
Agile Programming Live - AgilePrague2012Agile Programming Live - AgilePrague2012
Agile Programming Live - AgilePrague2012
Johannes Brodwall
 
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
Tarek Alabd
 
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
Dwayne Bailey
 
Microsoft at NFB
Microsoft at NFBMicrosoft at NFB
Microsoft at NFB
Microsoft Accessibility
 

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

Coding dojo
Coding dojoCoding dojo
Coding dojo
Rafael Rosa
 
The obstacles of developer productivity.pptx
The obstacles of developer productivity.pptxThe obstacles of developer productivity.pptx
The obstacles of developer productivity.pptx
Laurence Chen
 
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
Johan De Wit
 
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
 
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
Anton Dimitrov
 
Professional development
Professional developmentProfessional development
Professional development
Julio Martinez
 
Pair programming
Pair programmingPair programming
Pair programming
Gabriel Moral
 
Simple vs Easy
Simple vs EasySimple vs Easy
Simple vs Easy
Twentify
 
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
 
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
Isaac Liao
 
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
preetikumara
 
Exploring design-alternatives-using-tdd
Exploring design-alternatives-using-tddExploring design-alternatives-using-tdd
Exploring design-alternatives-using-tdd
Alexandru Bolboaca
 
How to be a 10x Engineer
How to be a 10x EngineerHow to be a 10x Engineer
How to be a 10x Engineer
Nick Sullivan
 
Writing Tests Effectively
Writing Tests EffectivelyWriting Tests Effectively
Writing Tests Effectively
Paul Boocock
 
The Holistic Programmer
The Holistic ProgrammerThe Holistic Programmer
The Holistic Programmer
Jonas Auken
 
Public presentations for software engineers
Public presentations for software engineersPublic presentations for software engineers
Public presentations for software engineers
Roman Nikitchenko
 
How to run a hackday
How to run a hackdayHow to run a hackday
How to run a hackday
RichardWarburton
 
Engineer - Mastering the Art of Software
Engineer - Mastering the Art of SoftwareEngineer - Mastering the Art of Software
Engineer - Mastering the Art of Software
Cristiano Diniz da Silva
 
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?
Abimbola Idowu
 
Habits of scalable product organizations
Habits of scalable product organizationsHabits of scalable product organizations
Habits of scalable product organizations
Laszlo Fogas
 

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

Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 
42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert
vaishalijagtap12
 
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
OnePlan Solutions
 
The Role of DevOps in Digital Transformation.pdf
The Role of DevOps in Digital Transformation.pdfThe Role of DevOps in Digital Transformation.pdf
The Role of DevOps in Digital Transformation.pdf
mohitd6
 
What is Continuous Testing in DevOps - A Definitive Guide.pdf
What is Continuous Testing in DevOps - A Definitive Guide.pdfWhat is Continuous Testing in DevOps - A Definitive Guide.pdf
What is Continuous Testing in DevOps - A Definitive Guide.pdf
kalichargn70th171
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio, Inc.
 
How GenAI Can Improve Supplier Performance Management.pdf
How GenAI Can Improve Supplier Performance Management.pdfHow GenAI Can Improve Supplier Performance Management.pdf
How GenAI Can Improve Supplier Performance Management.pdf
Zycus
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
gapen1
 
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and MoreManyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
narinav14
 
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
campbellclarkson
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
ervikas4
 
Penify - Let AI do the Documentation, you write the Code.
Penify - Let AI do the Documentation, you write the Code.Penify - Let AI do the Documentation, you write the Code.
Penify - Let AI do the Documentation, you write the Code.
KrishnaveniMohan1
 
Orca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container OrchestrationOrca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container Orchestration
Pedro J. Molina
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
Yara Milbes
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
Building API data products on top of your real-time data infrastructure
Building API data products on top of your real-time data infrastructureBuilding API data products on top of your real-time data infrastructure
Building API data products on top of your real-time data infrastructure
confluent
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
Beginner's Guide to Observability@Devoxx PL 2024
Beginner's  Guide to Observability@Devoxx PL 2024Beginner's  Guide to Observability@Devoxx PL 2024
Beginner's Guide to Observability@Devoxx PL 2024
michniczscribd
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
Maitrey Patel
 
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdfThe Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
kalichargn70th171
 

Recently uploaded (20)

Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 
42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert42 Ways to Generate Real Estate Leads - Sellxpert
42 Ways to Generate Real Estate Leads - Sellxpert
 
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...Transforming Product Development using OnePlan To Boost Efficiency and Innova...
Transforming Product Development using OnePlan To Boost Efficiency and Innova...
 
The Role of DevOps in Digital Transformation.pdf
The Role of DevOps in Digital Transformation.pdfThe Role of DevOps in Digital Transformation.pdf
The Role of DevOps in Digital Transformation.pdf
 
What is Continuous Testing in DevOps - A Definitive Guide.pdf
What is Continuous Testing in DevOps - A Definitive Guide.pdfWhat is Continuous Testing in DevOps - A Definitive Guide.pdf
What is Continuous Testing in DevOps - A Definitive Guide.pdf
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
 
How GenAI Can Improve Supplier Performance Management.pdf
How GenAI Can Improve Supplier Performance Management.pdfHow GenAI Can Improve Supplier Performance Management.pdf
How GenAI Can Improve Supplier Performance Management.pdf
 
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
如何办理(hull学位证书)英国赫尔大学毕业证硕士文凭原版一模一样
 
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and MoreManyata Tech Park Bangalore_ Infrastructure, Facilities and More
Manyata Tech Park Bangalore_ Infrastructure, Facilities and More
 
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
🏎️Tech Transformation: DevOps Insights from the Experts 👩‍💻
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
 
Penify - Let AI do the Documentation, you write the Code.
Penify - Let AI do the Documentation, you write the Code.Penify - Let AI do the Documentation, you write the Code.
Penify - Let AI do the Documentation, you write the Code.
 
Orca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container OrchestrationOrca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container Orchestration
 
The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024The Rising Future of CPaaS in the Middle East 2024
The Rising Future of CPaaS in the Middle East 2024
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
Building API data products on top of your real-time data infrastructure
Building API data products on top of your real-time data infrastructureBuilding API data products on top of your real-time data infrastructure
Building API data products on top of your real-time data infrastructure
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
Beginner's Guide to Observability@Devoxx PL 2024
Beginner's  Guide to Observability@Devoxx PL 2024Beginner's  Guide to Observability@Devoxx PL 2024
Beginner's Guide to Observability@Devoxx PL 2024
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
 
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdfThe Comprehensive Guide to Validating Audio-Visual Performances.pdf
The Comprehensive Guide to Validating Audio-Visual Performances.pdf
 

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