tdd-workflow
Installation
SKILL.md
Test-Driven Development
Write a failing test → make it pass simply → refactor. The tests are a design tool that produce a regression net as a by-product.
The loop (2–10 minutes per cycle)
- Test list: brainstorm behaviors/edge cases; pick the simplest next one.
- RED: write one small failing test; run it; see it fail for the right reason (message says what you expect).
- GREEN: write the least code to pass — fake it, hard-code, triangulate with a second example.
- REFACTOR: remove duplication, improve names, keep all green. No new behavior here.
- Commit; pick the next item. Update the list with anything learned.
RED test_fizzbuzz_returns_1_for_1 → NameError
GREEN def fizzbuzz(n): return "1"
RED test_returns_2_for_2 → "1" != "2"
GREEN def fizzbuzz(n): return str(n) # triangulated