5. Four elements of simple design
1. Passes its tests
2. Minimizes duplication (of concepts)
3. Maximizes clarity (naming, intent)
4. Has fewer elements (as small as possible)
6. TDD as if you meant it
Write one failing test
Make it pass by writing implementation code in the test method
When duplication is spotted extract implementation from tests to:
a new method in the test class
an existing method in the test class
When more methods belong together extract them into a new class
Refactor as required
7. Taking baby steps
Setup source control repository.
Setup a timer for 2 minutes interval when you start.
Write exactly one test
If the timer rings and the test is red then revert and start over.
If the test is green before timer rings then commit.
Restart timer (no discussions in between timers)
Refactor
If the timer rings and the refactoring is not complete then revert and
start over.
If the refactoring is complete before the timer rings then commit.
Restart the timer (no discussions in between timers)