testdriven development, why how and smells
DESCRIPTION
These are the slides used in our Mastering Agile Development session in September 2012. It gives some insights into the why, how and smells of doing TestDriven DevelopmentTRANSCRIPT
![Page 1: TestDriven Development, Why How and Smells](https://reader035.vdocuments.mx/reader035/viewer/2022062513/554f9148b4c9052a518b53c1/html5/thumbnails/1.jpg)
Test Driven Development
![Page 2: TestDriven Development, Why How and Smells](https://reader035.vdocuments.mx/reader035/viewer/2022062513/554f9148b4c9052a518b53c1/html5/thumbnails/2.jpg)
Scrum is Hot, but…
Many Scrum teams are struggling• Slow down (fewer features/sprint)– More and more production issues– Increased fragility
• Requests for ‘refactoring’ stories from development team
![Page 3: TestDriven Development, Why How and Smells](https://reader035.vdocuments.mx/reader035/viewer/2022062513/554f9148b4c9052a518b53c1/html5/thumbnails/3.jpg)
• Regression testing is demanded– Takes up lots of time in a sprint– Sprints start to lengthen
• Documentation becomes an issue because Agile teams “don’t do” documentation.
• Technical debt is introduced via “Copy and paste coding”.
Scrum is Hot, but…
![Page 4: TestDriven Development, Why How and Smells](https://reader035.vdocuments.mx/reader035/viewer/2022062513/554f9148b4c9052a518b53c1/html5/thumbnails/4.jpg)
10 Year Agile Manifesto meet up 2011 concluded
“As a group, we agreed on the following four belief statements:
• Demand technical excellence• Promote individual change and lead organizational change• Organize knowledge and improve education• Maximize value creation across the entire process”
![Page 5: TestDriven Development, Why How and Smells](https://reader035.vdocuments.mx/reader035/viewer/2022062513/554f9148b4c9052a518b53c1/html5/thumbnails/5.jpg)
Combine Scrum with XP
![Page 6: TestDriven Development, Why How and Smells](https://reader035.vdocuments.mx/reader035/viewer/2022062513/554f9148b4c9052a518b53c1/html5/thumbnails/6.jpg)
![Page 7: TestDriven Development, Why How and Smells](https://reader035.vdocuments.mx/reader035/viewer/2022062513/554f9148b4c9052a518b53c1/html5/thumbnails/7.jpg)
Test Driven Development
![Page 8: TestDriven Development, Why How and Smells](https://reader035.vdocuments.mx/reader035/viewer/2022062513/554f9148b4c9052a518b53c1/html5/thumbnails/8.jpg)
![Page 9: TestDriven Development, Why How and Smells](https://reader035.vdocuments.mx/reader035/viewer/2022062513/554f9148b4c9052a518b53c1/html5/thumbnails/9.jpg)
Uncle Bob About TDD
“The act of writing a unit test is more an act of design than of verification. It is also more an act
of documentation than of verification.
The act of writing a unit test closes a remarkable number of feedback loops, the least of which is the one pertaining to verification of function”
![Page 10: TestDriven Development, Why How and Smells](https://reader035.vdocuments.mx/reader035/viewer/2022062513/554f9148b4c9052a518b53c1/html5/thumbnails/10.jpg)
Kent Beck about TDD
“TDD encourages simple designs and inspires confidence”
![Page 11: TestDriven Development, Why How and Smells](https://reader035.vdocuments.mx/reader035/viewer/2022062513/554f9148b4c9052a518b53c1/html5/thumbnails/11.jpg)
![Page 12: TestDriven Development, Why How and Smells](https://reader035.vdocuments.mx/reader035/viewer/2022062513/554f9148b4c9052a518b53c1/html5/thumbnails/12.jpg)
About Unit Testing
“A procedure used to validate that individual units of source code are working properly.
A unit is the smallest testable part of an application. In procedural programming a unit may be
an individual program, function, procedure, etc., while in object oriented programming,
the smallest unit is a method.”
![Page 13: TestDriven Development, Why How and Smells](https://reader035.vdocuments.mx/reader035/viewer/2022062513/554f9148b4c9052a518b53c1/html5/thumbnails/13.jpg)
Why Unit Tests?• Avoid Combinatorial Complexity• Fine grained makes it easy to pin-point defects• Coded documentation that stays in sync• Supports changing the code• Supports collective code ownership
![Page 14: TestDriven Development, Why How and Smells](https://reader035.vdocuments.mx/reader035/viewer/2022062513/554f9148b4c9052a518b53c1/html5/thumbnails/14.jpg)
Source: Agile in a Flash by Jeff Langr and Tim Ottinger
![Page 15: TestDriven Development, Why How and Smells](https://reader035.vdocuments.mx/reader035/viewer/2022062513/554f9148b4c9052a518b53c1/html5/thumbnails/15.jpg)
![Page 16: TestDriven Development, Why How and Smells](https://reader035.vdocuments.mx/reader035/viewer/2022062513/554f9148b4c9052a518b53c1/html5/thumbnails/16.jpg)
Things we forget while coding
• SOLID principle– Lower Complexity– Loosely Coupled– Tighter cohesion
• Keep focus on Simple Design– YAGNI, DRY
• Continues Refactoring
![Page 17: TestDriven Development, Why How and Smells](https://reader035.vdocuments.mx/reader035/viewer/2022062513/554f9148b4c9052a518b53c1/html5/thumbnails/17.jpg)
![Page 18: TestDriven Development, Why How and Smells](https://reader035.vdocuments.mx/reader035/viewer/2022062513/554f9148b4c9052a518b53c1/html5/thumbnails/18.jpg)
Source: Agile in a Flash by Jeff Langr and Tim Ottinger
![Page 19: TestDriven Development, Why How and Smells](https://reader035.vdocuments.mx/reader035/viewer/2022062513/554f9148b4c9052a518b53c1/html5/thumbnails/19.jpg)
TDD mantras
![Page 20: TestDriven Development, Why How and Smells](https://reader035.vdocuments.mx/reader035/viewer/2022062513/554f9148b4c9052a518b53c1/html5/thumbnails/20.jpg)
TDD mantrasGiven, When, Then or Arrange, Act, Assert
![Page 21: TestDriven Development, Why How and Smells](https://reader035.vdocuments.mx/reader035/viewer/2022062513/554f9148b4c9052a518b53c1/html5/thumbnails/21.jpg)
Source: Agile in a Flash by Jeff Langr and Tim Ottinger
![Page 22: TestDriven Development, Why How and Smells](https://reader035.vdocuments.mx/reader035/viewer/2022062513/554f9148b4c9052a518b53c1/html5/thumbnails/22.jpg)
Source: Agile in a Flash by Jeff Langr and Tim Ottinger
![Page 23: TestDriven Development, Why How and Smells](https://reader035.vdocuments.mx/reader035/viewer/2022062513/554f9148b4c9052a518b53c1/html5/thumbnails/23.jpg)
START NOW!
![Page 24: TestDriven Development, Why How and Smells](https://reader035.vdocuments.mx/reader035/viewer/2022062513/554f9148b4c9052a518b53c1/html5/thumbnails/24.jpg)