Test-driven development (TDD) is a skill that takes patience to master—you can’t learn it reading a book. As with learning any new language, to gain fluency you need to practice TDD with competent coaching and lots of hard work. Many well-intentioned programmers try and finally give up on TDD because they never develop the fluency it requires. On stage, Llewellyn Falco leads a live TDD demonstration, talking through the process and microsteps of: (1) studying a feature, (2) creating an initial test, and (3) iteratively developing the related test code and feature code until the feature is completely programmed. Watch how to iteratively write a test, see it fail, and then write the feature code to make it pass. After explaining the theory behind the particular TDD technique used, Llewellyn leads participants in testing progressively more complex objects and scenarios.
6. Is Testing Faster? (Test After)
60 Minutes
Work (code)
X minutes
Non-Work(tests)
Code
<
60 Minutes
Code + Test
60 + X minutes
7. Is Testing Faster? (Test 1st)
60 – Time Saved
30 Minutes
Work (code)
X minutes
Non-Work(tests)
Code
60 Minutes <
?
Test + Code
X + 30 minutes
8. Today’s Kata: Triangle
1) A side has a distance
2) Side knows endpoints
3) 3 points
4) 3 sides
5) Perimeter
6) Get sides touching a point
7) Get side opposite a point
8) The angle of 2 sides touching a point
9) 3 angles
10) Right Triangle
18. Verification
Is it the right answer?
1. Change the Question
2. Ask an expert
19. Completing the Circle
Your output should tell the story.
Objects should have ToStrings
Benefits
1. Specification
2. Feedback
3. Regression
4. Granularity
20. Fake it Till You Make It
Buys some time
Allows for Triangulation
21. Today’s Kata: Triangle
1) A side has a distance
2) Side knows endpoints
3) 3 points
4) 3 sides
5) Perimeter
6) Get sides touching a point
7) Get side opposite a point
8) The angle of 2 sides touching a point
9) 3 angles
10) Right Triangle