Red/green/refactor:
- Red: Write a test that does not work, maybe does not even compile
- Green: Make the test work quickly, be OK with any "sins" this might entail
- Refactor: Eliminate duplication and "sins"
Social effects of writing tests:
- Low defect density means QA can be proactive not reactive
- Reduced number of nasty surprises means project managers can actually involve real customers
- Clarified technical conversations means teams can work on a minute-by-minute basis rather than daily/weekly
- Having shippable software everyday leads to new business relationships with customers
"Regression tests are tests that, with perfect foreknowledge, you would have written when coding originally. Every time you have to write a regression test, think about how you would have known to write the test in the first place." (page 138)
What don't you have to test? Phlip: "Write tests until fear is transformed into boredom." (page 194)
Write tests for:
- Conditionals
- Loops
- Operations
- Polymorphism
"But only those that you write. Unless you have reason to distrust it, don't test code from others."