← Browse by Chapter
Get the Book →
#115Chapter 21 — TDD with Claude Code
Check first that the working tree is clean, and stop if it is not. Then check the tests of [function] by breaking it on purpose, one small change at a time: flip a comparison, move a boundary by one, drop a term, change a constant. After each change, run the tests, note whether any test failed, and undo the change before the next one. Report every change no test caught, with its line. Leave the code exactly as it was, and show me git diff to prove it.

Mastering Claude Code
These prompts are excerpts from the book. Get the full collection with explanations and use cases.