Tests & QA21 categories
Test the error paths
When every existing test exercises the happy path.
Write tests for the failure behaviour of the code below. Cover: 1. Every external call failing: timeout, connection refused, 500, malformed response, slow response that eventually succeeds. 2. Invalid input at each entry point, including input that is valid in type but impossible in meaning. 3. Partial failure: the operation half completed. Assert the state we are left in. 4. Failure during cleanup or rollback. 5. Repeated failure, to check for retry storms or unbounded growth. For each, assert three things: the caller sees a useful error, no data is corrupted, and the system can carry on. Point out any error path that is currently unreachable, and any catch block that swallows the cause. Code:
Making it yours
- Paste your own material where the prompt asks for it. Everything above that line is instruction, not content.
- Delete any rule that does not apply to you. A shorter prompt that fits beats a thorough one that does not.
- If the answer comes back vague, add a line saying what you do not want. Constraints work better than encouragement.
Finding coverage gaps. Working out which behaviours, edge cases and error paths nothing currently checks.
Related prompts
Audit this suite for untested behaviourYou wrote tests and want to know what you did not think of.Write test cases from acceptance criteriaA story is ready for QA and the criteria need turning into concrete checks.Find property-based test ideasCode with a large input space where example tests only scratch it.Brainstorm edge cases for this featureBefore writing tests, to widen the input space you are imagining.What is untested here?Code with tests you suspect are not covering much.Fifteen edge cases, list onlyA function you are about to call finished.
Keep this one
Phrasery saves prompts with a right-click and puts them back the same way. Add this to your own library in one click.
Add to your browser โ free