Stage 5 of 10 · 6 lessons · ~2 weeks
Tests first, so AI output is checked
Use tests as the specification and the judge: write the first test yourself, recognise tests that cannot fail, list edge cases, and give the agent a check it must pass and show you.
Start: Tests as the specificationLessons· one lesson for each topic, in this order
Do this
- Write one feature test-first, watching the first test fail before any code exists.
- Ask your tool for more test cases and keep only the ones that test real behaviour.
- Break the code on purpose and confirm at least one test fails.
- Add the "never edit tests to pass" rule to your instructions file.
- Make the agent run your checks and paste the output on every task for a week.
- Try a mutation testing tool on one module and fix one surviving mutant.
Start with· follow one of these
- BookFreeTest-Driven Development with Python (Obey the Testing Goat)
Harry Percival · Intermediate
Free online: test-driven development taught step by step on a real web app
- BookPaidTest Driven Development: By Example
Kent Beck (Addison-Wesley) · Intermediate · Paid
Kent Beck's short classic on the red, green, refactor loop, worked through by example
Practise
Keep handy
Also worth your time
Before moving on: A feature built test-first with your tool: your own first test, a reviewed set of extra cases, a deliberate break that the suite catches, and agent runs where you saw every test command and its output.

Tests are how you stay in charge of an agent. Without them you are the only check, and you will get tired before it does. Write the first test yourself every time: it is where you decide what the code should do, and it keeps your testing muscles working.