Test-first red-green loop
Writes failing tests first, then implements without touching the tests until they pass.
How each pass goes
- Write tests for the behaviour; confirm they fail.
- Implement the smallest change.
- Run tests; repeat without editing them.
Stops when
All the new tests pass and none were weakened.
Starter prompt
Write tests for this behaviour first and show that they fail. Then implement in small steps, running the tests after each, without editing the tests. Stop when they all pass; refactor only while they stay green.