The process:
- Write (initial failing) test to describe a behavior
- Write own tests to avoid waiting
- Implement to make test pass with minimum codes (refuse single line of code without a test)
- Design consists of highly cohesive, loosely coupled components
- Require environment to provide rapid response to small changes (fast compiler, regression test suite)
- Refactor to conform standard
- Repeat
Do it in small steps.
- Acceptance TDD (ATDD or Behavior Driven Development BDD)
- Acceptance test (or aka behavior specification)
- Developer TDD
- Developer test / unit test
- Run fast
- Test with a purpose (archive 100% coverage)
- In isolation (able to reorder)
- Easy to read and understand
- Real data (from production)
- Represents one step towards overall goal
Requires tools to support test/development process
- Always think of specification before function code
- Tests as specification
- Programmers prefer code than documentation
- Tests probably not sufficient documentation but important part of it
- Code always tested
- Encourage to write clean code that works