1. Test Driven
Development
Pittsburgh Agile Group
May 24, 2011
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
2. Our Tests
It == This Presentation
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
3. Our Tests
It == This Presentation
ā¢ it should deļ¬ne TDD
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
4. Our Tests
It == This Presentation
ā¢ it should deļ¬ne TDD
ā¢ it should explain why TDD works
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
5. Our Tests
It == This Presentation
ā¢ it should deļ¬ne TDD
ā¢ it should explain why TDD works
ā¢ it should explain why you should do TDD
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
6. Our Tests
It == This Presentation
ā¢ it should deļ¬ne TDD
ā¢ it should explain why TDD works
ā¢ it should explain why you should do TDD
ā¢ it should demonstrate TDD
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
7. What is TDD?
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
8. What is TDD?
ā¢ Simple, high-feedback incremental coding
technique
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
9. What is TDD?
ā¢ Simple, high-feedback incremental coding
technique
ā¢ Write tests as specs prior to code
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
10. What is TDD?
ā¢ Simple, high-feedback incremental coding
technique
ā¢ Write tests as specs prior to code
ā¢ Immediate feedback
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
11. Core of the cycle
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
12. History of TDD
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
13. History of TDD
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
14. History of TDD
ā¢ Devised by Ward
Cunningham
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
15. History of TDD
ā¢ Devised by Ward
Cunningham
ā¢ Honed by Kent Beck
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
16. History of TDD
ā¢ Devised by Ward
Cunningham
ā¢ Honed by Kent Beck
ā¢ Incorporated as one of XPās
practices
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
17. History of TDD
ā¢ Devised by Ward
Cunningham
ā¢ Honed by Kent Beck
ā¢ Incorporated as one of XPās
practices
ā¢ Buzzword History
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
18. History of TDD
ā¢ Devised by Ward
Cunningham
ā¢ Honed by Kent Beck
ā¢ Incorporated as one of XPās
practices
ā¢ Buzzword History
ā¢ Test-ļ¬rst programming
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
19. History of TDD
ā¢ Devised by Ward
Cunningham
ā¢ Honed by Kent Beck
ā¢ Incorporated as one of XPās
practices
ā¢ Buzzword History
ā¢ Test-ļ¬rst programming
ā¢ Test-ļ¬rst design
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
20. History of TDD
ā¢ Devised by Ward
Cunningham
ā¢ Honed by Kent Beck
ā¢ Incorporated as one of XPās
practices
ā¢ Buzzword History
ā¢ Test-ļ¬rst programming
ā¢ Test-ļ¬rst design
ā¢ Test-driven development
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
21. TDD and Testing
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
22. TDD and Testing
ā¢ Creates testable code
by deļ¬nition
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
23. TDD and Testing
ā¢ Creates testable code
by deļ¬nition
ā¢ Obvious but signiļ¬cant
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
24. TDD and Testing
ā¢ Creates testable code
by deļ¬nition
ā¢ Obvious but signiļ¬cant
ā¢ Writing tests after code
built is much harder
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
25. TDD and Testing
ā¢ Creates testable code
by deļ¬nition
ā¢ Obvious but signiļ¬cant
ā¢ Writing tests after code
built is much harder
ā¢ Therefore fewer tests
get written
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
26. TDD and Testing
ā¢ Creates testable code
by deļ¬nition
ā¢ Obvious but signiļ¬cant
ā¢ Writing tests after code
built is much harder
ā¢ Therefore fewer tests
get written
ā¢ Minimizes defects
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
27. More Importantly...
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
28. More Importantly...
ā¢ Promotes better design
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
29. More Importantly...
ā¢ Promotes better design
ā¢ Teaches you how to design isolated classes
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
30. More Importantly...
ā¢ Promotes better design
ā¢ Teaches you how to design isolated classes
ā¢ Creates comprehensive developer
documentation
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
31. More Importantly...
ā¢ Promotes better design
ā¢ Teaches you how to design isolated classes
ā¢ Creates comprehensive developer
documentation
ā¢ Development Pacing
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
32. TDD Rules
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
33. TDD Rules
ā¢ Test everything that
could possibly break
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
34. TDD Rules
ā¢ Test everything that
could possibly break
ā¢ Do not write any
production code until
you have a failing test
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
35. TDD Rules
ā¢ Test everything that
could possibly break
ā¢ Do not write any
production code until
you have a failing test
ā¢ Code is not checked
in until 100% of unit
tests run
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
36. Our Tests
It == This Presentation
ā¢ it should deļ¬ne TDD
ā¢ it should explain why TDD works
ā¢ it should explain why you should do TDD
ā¢ it should demonstrate TDD
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
37. Our Tests
It == This Presentation
ā¢ it should deļ¬ne TDD
ā¢ it should explain why TDD works
ā¢ it should explain why you should do TDD
ā¢ it should demonstrate TDD
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
38. Why does it work?
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
39. Why does it work?
Pleasure spiked with Pain!
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
40. Why does it work?
Pleasure spiked with Pain!
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
41. Why does it work?
Pleasure spiked with Pain!
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
42. Long Methods
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
43. Long Methods
Pain!
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
44. Many Dependencies
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
45. Many Dependencies
Pain!
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
46. Doing too much
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
47. Doing too much
Pain!
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
48. Keep it clean
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
49. Keep it clean
Pleasure
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
50. Feel good
Pleasure
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
51. Our Tests
It == This Presentation
ā¢ it should deļ¬ne TDD
ā¢ it should explain why TDD works
ā¢ it should explain why you should do TDD
ā¢ it should demonstrate TDD
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
52. Our Tests
It == This Presentation
ā¢ it should deļ¬ne TDD
ā¢ it should explain why TDD works
ā¢ it should explain why you should do TDD
ā¢ it should demonstrate TDD
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
53. Nature
^
F
T>
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
54. Nature
X
^
F
T>
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
55. Nature
X
^
F
T>
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
56. Nature
X
^
F
T>
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
57. Nature
X
^
F
T>
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
58. Nature
X
^
F
T>
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
59. Design Evolves
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
60. Design Evolves
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
61. Design Evolves
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
62. Design Evolves
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
63. Design Evolves
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
64. Design Evolves
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
66. We Do Scrum!
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
67. We Do Scrum!
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
68. We Do Scrum!
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
69. Professionalism
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
70. Our Tests
It == This Presentation
ā¢ it should deļ¬ne TDD
ā¢ it should explain why TDD works
ā¢ it should explain why you should do TDD
ā¢ it should demonstrate TDD
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
71. Our Tests
It == This Presentation
ā¢ it should deļ¬ne TDD
ā¢ it should explain why TDD works
ā¢ it should explain why you should do TDD
ā¢ it should demonstrate TDD
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
72. Demo Time
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
73. Our Tests
It == This Presentation
ā¢ it should deļ¬ne TDD
ā¢ it should explain why TDD works
ā¢ it should explain why you should do TDD
ā¢ it should demonstrate TDD
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
74. Our Tests
It == This Presentation
ā¢ it should deļ¬ne TDD
ā¢ it should explain why TDD works
ā¢ it should explain why you should do TDD
ā¢ it should demonstrate TDD
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
75. Final Thoughts
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
76. Final Thoughts
ā¢ TDD is here to stay
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
77. Final Thoughts
ā¢ TDD is here to stay
ā¢ A satisfying and enriching practice that can
dramatically increase the quality of your
application
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
78. Final Thoughts
ā¢ TDD is here to stay
ā¢ A satisfying and enriching practice that can
dramatically increase the quality of your
application
ā¢ Diligent adherence to practice is required
to succeed
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.
79. Final Thoughts
ā¢ TDD is here to stay
ā¢ A satisfying and enriching practice that can
dramatically increase the quality of your
application
ā¢ Diligent adherence to practice is required
to succeed
ā¢ But the beneļ¬ts are worth it
Copyright 2011 LeanDog, Inc. All Rights Reserved. Do not copy or distribute without permission.