Exercise 28. sh
You are now going to continue your TDD-style process, but you’ll add a small hack session to start. The best method for working in TDD is to actually not write the tests first but instead to work this way:
1. Spend 45 minutes doing a hack to study the problem. This is called a “spike” and is intended to iron out issues you may run into or research things you need to know.
2. Plan out what you’ll probably need to implement with a TODO list.
3. Turn this plan into a TDD test.
4. Run the test to make sure it fails.
5. Write the code for the test, using what you learned from the spike.
6. Audit your code and test to confirm quality.
This process is what I see TDD fanatics actually use when pressed with a problem they haven’t studied ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access