Compare
Whiplash Driven Development vs test-driven development
TDD and WDD fit together: TDD gives you the failing tests, and WDD gives you an agent that is pushed until they pass. In WDD the human's main job becomes the TDD part: writing the checks that define done.
What test-driven development is
Test-driven development (TDD) is the practice of writing a failing test first, then the smallest code that makes it pass, then refactoring, in short cycles.
Side by side
| Whiplash Driven Development | Test-driven development | |
|---|---|---|
| Who writes the tests | Usually the human (or a separate, earlier agent session) | The developer |
| Who writes the code | The agent, round after round | The developer |
| Cycle length | A round: minutes | Seconds to minutes |
| Changing tests to pass | Forbidden | Allowed when the test was wrong, by the developer's judgement |
Using them together
Write the tests TDD-style, protect them, then let a WDD loop do the red-to-green part. The tests are the metronome.
Which to choose
- Choose WDD when the tests exist (or can be written) and the code to pass them is a long grind.
- Choose test-driven development when you are designing the code as you go and want each step in your own hands.
Questions people ask
Can the agent write the tests too?
Yes, in a separate step that a person reviews and then locks. If the same session writes the tests and the code, it can make both easy.