Tests that would have caught the last bug
Not 100% coverage. The five tests that protect what actually matters.
Any project you've fixed the same bug in twice.testingqualityregressions
Write the small set of tests that would protect this code from the bugs it has actually had.
The code: <paste the module or functions>
What it's supposed to do: <one paragraph>
Bugs it has had, or nearly had: <describe each in a line>
Testing setup: <framework, where tests live, an example existing test if you have one>
Produce:
1. The 5–8 behaviours most worth protecting, ranked. For each: why it matters, and which past bug it relates to, if any.
2. One test per behaviour, in my framework and style, each with a name that reads as a sentence ("rejects an order with the wrong email").
3. For each test: the setup, the action, the assertion, and nothing else. No shared magic; readable on its own.
4. Edge cases you deliberately chose not to test yet, and why.
5. One test that would currently FAIL if I'm right about a bug that still exists. Say which line of code you think is wrong.
Do not aim for coverage. Aim for the tests I'd be grateful for at 2 a.m.Replace every <placeholder> with your own details before you send it.
How to use it
- 1Describe the bugs you've actually had. Tests aimed at real failures are worth ten aimed at hypotheticals.
- 2Ask for the tests in your existing framework and folder. Consistency beats cleverness.
- 3Run them before asking for more. A failing test is information.
Reviewed 2026-09-20
Good prompts are a skill. Proof of what you build is a career.
Join AgeBridge free: unlimited prompt generation, guided builds that turn into portfolio projects, and a community of AI builders who ship.
- Unlimited prompt generator
- Guided builds that become proof on your profile
- A public profile businesses can find
Related prompts
Vibe Coding
Review the code the AI just wrote
A second model, a skeptical eye, and a list of what to fix before you ship.
Review this code as a senior engineer who assumes it was generated quickly and needs to be trusted in production. What the code is supposed…
Open prompt
Vibe Coding
Refactor without changing behaviour
Same outputs, cleaner code, and a way to prove nothing moved.
Refactor this code without changing what it does. You are a disciplined engineer who makes small, provable changes. The code: <paste> What…
Open prompt
Vibe Coding
Write the spec before the first prompt
One page the AI can actually follow: screens, data, rules, and what's out.
You are a product engineer who writes specs that AI coding tools can follow without guessing. Help me write a one-page spec before I build…
Open prompt
Prompt text is written by AgeBridge and free to use. Results depend on the model and on the details you provide.