Test Coverage Plan Before a Risky Change
Decide what tests to write first when coverage is poor.
The Open buttons send the prompt text as currently shown below to that site only when you click. Fill in the placeholders first.
Plan tests before changing [AREA_OF_CODE]. Current tests: [CURRENT_TESTS]. Most important behaviours: [KEY_BEHAVIOURS]. Known bugs: [KNOWN_BUGS]. Time: [TIME]. List behaviours by importance and risk. Choose test levels: unit for logic, integration for data and services, end-to-end only for the critical path. Write test case names and expected results for the top fifteen, with sample data. Use characterisation tests where the correct behaviour is unclear and mark them as such. Return a prioritised table, a note on test data and fakes, a coverage target as a goal not a guarantee, and a definition of done for starting the change. Say plainly that coverage numbers do not prove correctness. Add a short list of the common mistakes when adding tests to old code: asserting on incidental details, using real services, sharing state between tests and writing tests that always pass. Provide a template for a characterisation test with sample inputs and recorded outputs, and a note on reviewing these tests with someone who knows the product, because they record what the code does, not necessarily what it should do.
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.