C4D Practice
← Browse by Chapter
#116Chapter 21 — TDD with Claude Code
Before we change [function], pin what it does today. Write tests that call it with [representative inputs, including the odd ones seen in production]. Get each expected output by running the function, not by reading the code, and assert what it returns today, even where it looks wrong. Run the new tests and show me that they all pass on the current code. List separately every output you think is a bug, with your reason. Do not change the function.
Mastering Claude Code
Mastering Claude Code

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

Get the Book →