Stage 5 · Lesson 3 of 6
Writing the first test yourself
Write at least the first, most important test for any feature by hand. That test is where you decide what the code should do: the inputs, the expected output, the error cases. That decision is the engineering; the rest is typing.
Once it exists, ask the tool to suggest more cases, and review each one: is it testing behaviour, is it different from the others, would it fail if the code were wrong? Delete duplicates and cases that test the framework rather than your code.
Your own test also keeps your testing skills alive, which you need to judge generated tests at all.
Common trapaccepting fifty generated tests you never read, most of which check the same , the normal case where nothing goes wrong.
A question to check yourself, an AI practice session and 1 cheat sheet entry come when you add the roadmap to your account. Add it
Resources for this stage
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