Test Suite Gap Analysis Against Risk
Find important behaviour with no test protecting it.
The Open buttons send the prompt text as currently shown below to that site only when you click. Fill in the placeholders first.
Review my tests against what could hurt us. Description of the system and its most important behaviours: [SYSTEM_DESCRIPTION]. List of test files or test names with a one-line purpose: [TEST_LIST]. Past production bugs: [PAST_BUGS]. Language and framework: [STACK]. Map each important behaviour to the tests that cover it. Mark behaviours with no test, with only a happy-path test, or with tests that assert incidental details. Pay attention to error handling, boundaries, money or data changes, permissions, and anything that has broken before. Rank gaps by the damage a failure would cause and by how likely a change is to break it. Return a table with Behaviour, Existing tests, Gap, Risk and Suggested test, the ten tests to write first with example inputs and expected results, and a note on what coverage numbers cannot tell us. Do not claim a test passes without seeing it run. Add a worked mapping with invented behaviours. Behaviour: an order total includes tax and discount; tests: one happy-path test; gap: no test for a 100 percent discount, a negative price or rounding on three items; risk high because it changes money. Behaviour: a user without permission cannot view another user's invoice; tests: none; gap: authorisation untested; risk high. Behaviour: password reset email is sent once; tests: one; gap: duplicate requests; risk medium. Behaviour: the export file has the right columns; tests: a snapshot test that was re-recorded blindly after a change; gap: the test no longer protects anything; risk medium. Counts: of 12 important behaviours, 4 have no test, 5 have happy-path tests only, 3 are well covered, so 75 percent have a gap. Example tests to write first: a table of inputs and expected outputs, such as quantity 3, unit price 9.99, discount 100 percent, expected total 0.00, and tax rounded to the nearest cent per line, with the rounding rule written down. Add a note on risk-based thinking: write tests where a failure would cost most, not where code is easiest to test. Include a plan to add one test for every production bug found, named after the bug, and a quarterly review of the gap table. Remind me that I am reviewing descriptions, and the real coverage must be checked by running the suite.
Fill in before use
Optional: type your details and the prompt above updates. Nothing is saved or sent.
Replace each bracketed placeholder with your own details, then paste into Any AI or another assistant.
See an example result (fictional data)
Invented behaviours and tests. Order total includes tax and discount: one happy-path test; gap: 100 percent discount, negative price, rounding on three items; risk high. Other users' invoices are hidden: no test; risk high. Reset email sent once: one test; gap: duplicate requests; risk medium. Export has the right columns: a snapshot re-recorded blindly; protects nothing; risk medium. Of 12 important behaviours: 4 untested, 5 happy path only, 3 well covered; 9 of 12 have a gap = 75 percent. First test to write: quantity 3, unit price 9.99, discount 100 percent, expected total 0.00.
Illustrative only, made-up data. Your results will differ and must be reviewed.