Skip to content

Have a coding agent write tests for code you already have

Point a coding agent at one module, have it list what the code should do, then write tests for each behavior and run them.

Claude CodeOpenAI Codex Blaze Fish recipe
43
Proof
10/40
Payoff
15/25
Ease
7/20
Cost
11/15
How the score works
Difficulty
Builder
Setup time
45 min
Monthly cost
$20/mo
What it saves
hours per module

How to do it

  1. Pick one module or file with no tests.
  2. Ask the agent to describe its expected behavior in plain words first.
  3. Correct anything it got wrong.
  4. Have it write and run the tests, and report any real bugs it finds.

The prompt

Look at {{file_or_module}}. First, list every behavior it should have, including edge cases and error cases, in plain words. Wait for me to confirm.
Then write tests using {{test_framework}} that cover each one, run them, and report: passing, failing because of a test mistake (fix those), and failing because of a real bug (do not fix; explain).

Blaze School prompt pack

The full version adds variations, error handling and a checklist. It is part of Blaze School.

Members get every prompt pack.

See Blaze School plans Log in

Where this comes from

A build we designed. Not yet tested end to end.

Tried this? Tell us how it went and help move its proof level up.

Was this useful?