Below And Beneath Tdd Test Last Development And Other Real World Test Patterns Presentation
1. Below And
Beneath TDD
Test-Last Development and other
real world test patterns
Noel Rappin
@noelrap
Pathfinder Development
pathf.com
railsprescriptions.com
4. TEST REFACTOR
Why does testing work?
FAIL PASS
Why does testing fail?
CODE Rx
5. TEST REFACTOR
What does it mean for
testing to “work”?
FAIL PASS
CODE Rx
6. TEST REFACTOR
Improve effectiveness
of team and
quality of code
NOT
FAIL PASS
A perfect guarantee of
code correctness
CODE Rx
7. TEST REFACTOR
for me, tdd is about
confidence &
accountability &
responsibility & design &
reusability & portability &
flexibility & testing &
FAIL PASS
trustworthiness &
teamwork & initiative &
flow & that's all i can
think of at the moment.
CODE
-- Kent Beck
Rx
8. TEST REFACTOR
Accurate view of code
Small, incremental steps
FAIL PASS
Scaffold for change
Focus for development
CODE Rx
9. TEST REFACTOR
What does it mean for
testing to “fail”?
FAIL PASS
CODE Rx
10. TEST REFACTOR
Decrease efficiency and
code quality
FAIL PASS
CODE Rx
11. TEST REFACTOR
“It feels like there's a
hidden door that everyone
who tests has found and
walked through...
There are a bunch of us...
FAIL PASS
that would love to join
the party, but don't know
where to find
the door.”
CODE Rx
12. TEST REFACTOR
If you are stuck in a
window or banging your
head against the wall,
FAIL PASS
this will help
you get to the door
CODE Rx
47. CODE REFACTOR
CODE
CODE
CODE Test-Last Development PASS
CODE
CODE
CODE
TEST
Rx
48. CODE REFACTOR
CODE
Symptoms:
CODE
Significant coverage drop
CODE
PASS
Uncovered bugs
CODE
Harder to write tests
CODE
CODE
TEST
Rx
49. CODE REFACTOR
CODE
CODE This is one way in which
we talk past each other
CODE
PASS
Unit tests ≠ TDD
CODE
CODE
CODE
TEST
Rx
50. CODE REFACTOR
CODE Pitfall:
CODE Tests get more
CODE expensive
PASS
CODE Lower quality tests
CODE Programmer boredom
CODE
TEST
Rx
51. CODE REFACTOR
CODE
CODE Needed when:
CODE Hitting corner case PASS
CODE Dealing with legacy
CODE
CODE
TEST
Rx
52. CODE REFACTOR
CODE ☹Accurate view of code
CODE ☹Small, incremental steps
CODE
PASS
Scaffold for change
CODE
☹Focus for development
CODE
CODE
TEST
Rx
53. CODE REFACTOR
Escape by:
CODE
CODE Start the TDD process
CODE Don’t look back PASS
CODE Catch up to legacy
parts as you touch
CODE
them
CODE
TEST
Rx
55. CODE REFACTOR
CODE
CODE
CODE
Run
CODE
CODE
CODE
TEST
Rx
56. CODE REFACTOR
CODE
CODE
Coverage Driven
CODE Development Run
CODE
CODE
CODE
TEST
Rx
57. CODE REFACTOR
CODE
CODE
Symptom:
CODE
Run
Tests without assertions
CODE
CODE
CODE
TEST
Rx
58. CODE REFACTOR
CODE
Why?
CODE
Minimal approach to
CODE
Run
legacy
CODE
Hard to reach code
CODE
CODE
TEST
Rx
59. CODE REFACTOR
CODE ☹Accurate view of code
CODE ☹Small, incremental steps
CODE
Run
☹Scaffold for change
CODE
☹Focus for development
CODE
CODE
TEST
Rx