Talk given to Sydney Ruby (a.k.a. rorosyd) on 8 July, 2014. Inspired by the discussions that ensued from DHH's provocative pronouncement that "TDD is Dead".
22. James Coplien: “Why Most
Unit Testing is Waste”
Comprehensive, well-argued article
Well worth reading with an open mind
May challenge your preconceptions
23. James Coplien: “Why Most
Unit Testing is Waste”
“Keep unit tests that test key algorithms for which
there is a broad, formal, independent oracle of
correctness, and for which there is ascribable
business value.”
24. James Coplien: “Why Most
Unit Testing is Waste”
“Throw away tests that haven’t failed in a year.”
25. James Coplien: “Why Most
Unit Testing is Waste”
“Be humble about what tests can achieve. Tests
don’t improve quality: developers do.”
31. Gary Bernhardt: “TDD, Straw
Men, and Rhetoric”
tests respond before he has time to think
32. Gary Bernhardt: “TDD, Straw
Men, and Rhetoric”
“TDD is useful and test isolation is useful,
but they both involve making trade-offs.”
33.
34. Corey Haines: “Speeding Up
ActiveRecord Tests"
Specific suggestion to speed up ActiveRecord tests
using his active_record_spec_helper
35. Corey Haines: “Speeding Up
ActiveRecord Tests"
Isolation: only include the parts of the system
that are necessary
36.
37. Martin Fowler, Kent Beck &
DHH: “Is TDD Dead?”
Five discussions totally about three hours
38. Martin Fowler, Kent Beck &
DHH: “1. TDD and Confidence”
KB: TDD can, but does not necessarily, lead to flow
DHH: doesn’t like the conflation of TDD and
confidence from self-testing code
MF: heavy mocking isn’t mandatory in TDD
39. Martin Fowler, Kent Beck & DHH:
“2. Test-induced design damage”
KB to DHH: “TDD isn’t taking you anywhere.
You’re making the decisions.”
40. Martin Fowler, Kent Beck &
DHH: “3. Feedback and QA”
MF: categories of feedback:
1. user needs
2. regression tests
3. healthy codebase
DHH: notion of criticality
KB: it’s a continuum and set of trade-offs
41. Martin Fowler, Kent Beck &
DHH: “3. Feedback and QA”
“As soon as you think you’re not making
mistakes, you’re making mistakes.”
— Kent Beck
42. Martin Fowler, Kent Beck &
DHH: “4. Costs of Testing”
DHH: some tests are not justified
KB: delta coverage
MF: only test things that could possibly break
DHH: insufficient energy in refactoring
43. Martin Fowler, Kent Beck &
DHH: “5. Q & A; Summary”
KB: TDD helps problems to be broken down
MF: TDD with refactoring has often led to
good design
DHH: “most people cannot leave good ideas
the fuck alone”
44. Martin Fowler, Kent Beck &
DHH: “5. Summary”
KB: TDD is not dead but thanks for setting fire to it
DHH: TDD shouldn’t be mandated but we don’t
want to lose self-testing code
MF: if you’re going to be involved in software
development you have to be thoughtful
58. More References
• “Growing Object-Oriented Software, Guided by
Tests”, Steve Freeman & Nat Price
• “Rails 4 Test Prescriptions: Build a Healthy
Codebase”, Noel Rappin
• “Perfect Software and other illusions about
testing”, Gerald M. Weinberg