Coding with AI tools

Stage 5 · Lesson 3 of 6

Writing the first test yourself

Tests first, so AI output is checked

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

Practise

  • Every exercise ships with tests: practise reading them first, then writing your own extras

Keep handy

Also worth your time

Mark this stage as not done?