- Record a test that does not work
- Write an ugly code to pass this test
- Refactoring to improve code
In step 2, write code that does not implement the strategy template (the simplest thing that works even if duplicate code is present).
Then, in step 3, you reorganize each class one at a time into a strategy template, if that makes sense.
If you really do TDD, you are not starting with the template - you are reorganizing it.
source share