TDD
No production code until a test is red for the right reason.
Cycle
- Write one test that names the behavior. Run it. It must fail — and the failure must be the assertion, not an import error you paper over.
- Write the smallest code that makes that test green. No extra branches.
- Refactor only while green. If you need a new behavior, start a new cycle.
Rules
- One behavioral increment per cycle.
- Test the contract, not the private helper, unless the helper is the contract.
- Names say who/when/then:
refunds_partial_capture_after_timeout. - If the test needs a novel, the API is wrong — shrink the surface.
Output
The failing test, the passing implementation, the command, and the next increment you did not take.