Brainstorm edge-case test scenarios before you write tests
Enumerates grouped edge-case and adversarial test scenarios for a feature so nothing gets shipped untested.
Most production bugs aren't in the happy path—they're in the cases nobody thought to test: the empty list, the leap-second, the user who clicks twice, the input crafted to break you. This prompt is a brainstorming partner that enumerates those scenarios before you write any test code, organized into groups (boundaries, empty/null/zero, very large inputs, concurrency and ordering, malformed or malicious input, locale/timezone/encoding, and dependency failures) so you cover whole categories instead of a random handful. For each scenario it states the input, the expected behavior, and why it matters, then prioritizes which are most likely to expose real bugs—so you spend testing effort where it pays off. Describe the feature and its constraints clearly, and list known assumptions so the model can challenge them. Use the output as a test plan you hand to the unit-test prompt (or write yourself). It's especially valuable in code review and design, where catching a missing case on paper is far cheaper than in production.
You are an expert QA-minded engineer who finds the cases developers forget. For the feature or function described below, enumerate edge cases and adversarial scenarios I should test before shipping. Organize them into groups: boundary values, empty/null/zero, very large inputs, concurrency and ordering, malformed or malicious input, locale/timezone/encoding, and failure of external dependencies. For each scenario, state the input, the expected behavior, and why it matters. Do not write test code—produce the test plan. Feature and constraints: [FEATURE_DESCRIPTION]. Known assumptions: [ASSUMPTIONS]. Return a prioritized checklist of scenarios, marking which ones are most likely to expose real bugs.
What you can expect back
Prioritized edge cases:
Boundary values
- [HIGH] 100% code on a $50 cart → total is exactly 0, not negative; verify rounding.
- [HIGH] $5-off on a $4 cart → must not go negative (assumption 'totals positive' may break).
Empty/null/zero
- [HIGH] Empty cart (total 0) + any code → defined behavior, no divide-by-zero.
- [MED] Null/blank code → treated as 'no discount', not a crash.
Malformed/malicious
- [HIGH] Code '200%' or negative amount → reject; never inflate the total.
- [MED] Whitespace/case variants ('save5' vs 'SAVE5') → consistent matching.
Locale/encoding
- [MED] Fixed-amount in a different currency than the cart → reject or convert; don't subtract blindly.
Most likely to expose real bugs: the $5-off-on-$4 and 100%-discount cases—both stress the 'totals always positive' assumption you listed.Illustrative example — your results will vary by tool and inputs.
Get sharper results
- 01List your assumptions explicitly—the biggest bugs hide where an assumption silently fails.
- 02Feed the prioritized 'HIGH' cases straight into the unit-test generator prompt as your test table.
- 03Use it during code review: catching a missing case on paper is far cheaper than in prod.
- 04Re-run it after a bug escapes—ask what category the missed case belonged to, then cover the whole category.
Adapt it for your case
Add 'Emphasize abuse and security scenarios: injection, overflow, auth bypass, and rate-limit evasion.'
Add 'After the plan, write runnable tests in [framework] for the HIGH-priority scenarios only.'
Common questions
Does it write the tests?
By default it produces a prioritized plan, not code. Use the 'Generate the tests too' variation to turn the HIGH-priority items into runnable tests.
Why list my assumptions?
Many real bugs live exactly where an assumption breaks. Stating them lets the model deliberately design scenarios that challenge each one.
How is this different from a unit-test generator?
This finds which cases matter before any code exists; the unit-test prompt turns chosen cases into runnable test code. They're complementary.
You may also need
Debug an Error Message Step-by-Step
Get a structured debugging plan: error explanation, ranked root causes, tests, and fixes.
Design a RESTful API Endpoint Schema
Design a complete REST API schema with request/response bodies, status codes, and error cases.
Generate a Production-Ready Dockerfile and Explain Each Line
Generate a hardened, multi-stage Dockerfile with line-by-line comments and matching .dockerignore.
Explain and Write a Regex From Plain English
Translate a plain-English matching requirement into a regex with line-by-line breakdown and edge cases.