SlideShare a Scribd company logo
Test Driven Development
          It’s All about Fluency
          @LlewellynFalco
Is Testing Faster? (Test After)
                       60 Minutes
         Work (code)
                                    X minutes
         Non-Work(tests)

           Code
                 <
        60 Minutes
                        Code + Test
                       60 + X minutes
Is Testing Faster? (Test 1st)
                                       30 Minutes
         Work (code)
                           X minutes
         Non-Work(tests)


           Code
        60 Minutes   <
                     ?
                           Test + Code
                         X + 30 minutes
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
Test drivendevelopment   fluency
Parts of a Test
1) Do
2) Verify
Demo
Benefits of Unit Tests
1)   Specification
2)   Feedback
3)   Regression
4)   Granularity
Regression
If I used to get :
Then I still get :
Intentional Code

// Create a Side from (0,0) to (5,0)

var side = new Side(0,0,5,0);
Consume      1st

Write the objects & methods you wish existed
Test Until Bored
Test the cases that bring you value
Verification
 Is it the right answer?
 1. Change the Question
 2. Ask an expert
Completing the Circle
Your output should tell the story.
Objects should have ToStrings
                                     Benefits
                                     1. Specification
                                     2. Feedback
                                     3. Regression
                                     4. Granularity
Fake it Till You Make It
Buys some time
Allows for Triangulation
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
Verifying Multiples
Verify Single:
Approvals.Approve(result);

Verify Many:
Approvals.Approve(results, "label");
Multiple Cases
Approvals.Approve(cases, c => TestWith(c));
Maintaining Tests
Same Quality as Production Code
Test drivendevelopment   fluency
Resources
    Test Driven Development: By Example
                              Kent Beck
Resources
            www.ApprovalTests.com
Resources                    www.Develop.com

Intro To TDD Class (4 Day)
Legacy Code
TeachingKidsProgramming.org
Do a Recipe  Teach a Kid (Ages 10 ++)
Microsoft SmallBasic  Free Courseware (recipes)
Please fill out evaluations:
TDD – Fluency #AT11


@LlewellynFalco
http://LlewellynFalco.Blogspot.com
http://www.approvaltests.com                   @ArloBelshee
                                                 (Microsoft)
                                     http://www.arlobelshee.com

More Related Content

Test drivendevelopment fluency

Editor's Notes

  1. Both
  2. Both
  3. Both
  4. Both
  5. Both
  6. Both
  7. Both
  8. Both
  9. Both
  10. Both
  11. Both
  12. Both
  13. Both
  14. Both
  15. Both
  16. Both
  17. Both
  18. Both
  19. Both
  20. Both
  21. I add this slide at the end of EVERY presentation.
  22. Both