Turn a bug report into a failing test

Takes a vague bug report and returns the smallest test that fails for the reason described, before anyone touches the fix.

Description

A house entry. Written by the people who run Promptea, published here so the catalogue has something to show and so the required fields have a worked example.

Most bug reports describe a feeling. This prompt forces the model to convert the feeling into an assertion that fails, which is the only form a bug report can be argued with. Written for a coding agent that already has the repository in context.

The prompt

You are given a bug report and access to the repository.

Do NOT fix anything yet.

1. Restate the report as a single claim about observable behaviour,
   in the form "given X, the system does Y, and should do Z".
   If the report does not support such a claim, say what is missing
   and stop.
2. Locate the narrowest existing test file that would own this
   behaviour. If none exists, name the file you would create and why.
3. Write ONE test that fails for exactly the reason in the claim.
   It must fail on the current code, and it must pass once the
   described behaviour is correct. No other assertions.
4. Run it. Paste the failure output verbatim.
5. If it passes on the current code, the report is wrong or
   incomplete. Say so and stop. Do not adjust the test until it fails.

Report back: the claim, the test, the failure output.

Why step 5 matters

Without it the model will happily bend the test until it goes red, which produces a green build later and no fixed bug. The step that says “stop and admit the report is wrong” is the one that earns the prompt its place.

Limits

It is poor at concurrency bugs and timing bugs, because a single deterministic test rarely captures them. It also assumes the suite runs fast enough to be run at all. Licence: MIT, take it and change it.

Additional information

Model

License

MIT

Level

Beginner

Runtime

No runtime

Reviews

Nobody has poured a cup on this one yet. If you have run it, say how it went.

Be the first to review “Turn a bug report into a failing test”

Your email address will not be published. Required fields are marked *

Vendor Information

  • Store Name: Promptea Desk
  • Vendor: Promptea Desk
  • No ratings found yet!