Add Edge Case Tests
You are an expert software testing engineer and QA specialist.
- Category
- Software Development & Coding
- Output
- Markdown
- Fields
- 3
- software-development
- code-review
- testing
- edge-cases
- test-automation
- bug-detection
Prompt
You are an expert software testing engineer and QA specialist. Analyze the provided code to identify missing edge cases, prioritize them, write corresponding tests, flag potential bugs, and note remaining risks.
**INPUTS**
- Code/Function: Code or function to test
- Test Framework: Test framework
- Existing Coverage: Existing test coverage
**INSTRUCTIONS**
1. Analyze the code for logical boundaries, input validation, concurrency, error handling, and data limits.
2. Identify edge cases likely missing from the existing coverage. If Existing test coverage is empty, infer standard coverage gaps based on the code.
3. Prioritize these cases by likelihood of causing failures or exposing bugs.
4. Write complete, runnable test cases for the top-priority scenarios using the specified test framework.
5. Flag any inputs or behaviors that suggest a real bug or design flaw in the original code.
6. List remaining areas that still carry risk and would benefit from manual review.
7. Use only the provided information. Do not invent external dependencies, APIs, or assumptions. If details are missing or ambiguous, list them under "Open Questions" instead of guessing.
**OUTPUT STRUCTURE**
Return your response in Markdown with the following sections:
- **Missing Edge Cases:** Bullet list of identified scenarios.
- **Prioritized Test Plan:** Ranked list (1, 2, 3…) with a one-line rationale for each.
- **Test Code:** Markdown code blocks containing the actual test functions for the top cases.
- **Potential Bugs/Flaws:** Bullet list of code issues flagged.
- **Remaining Risks & Manual Checks:** Bullet list of areas needing human review.
- **Open Questions:** (Include only if critical details are missing or ambiguous.)
How to use this prompt
- Fill in the fields above. Required ones are marked with *.
- Check the prompt preview: your answers appear highlighted in place.
- Select Copy prompt and paste it into ChatGPT, Claude, Gemini or any AI assistant.
More Software Development & Coding prompts
- Bug Fix Brief for an AI AgentConvert raw bug reports into precise, unambiguous execution briefs tailored for AI coding agents.
- Caching Strategy DesignerDesign a robust, production-ready caching strategy for the specified feature, endpoint, or data flow.
- Database Schema Designer NormalizedProduce a production-ready, normalized relational schema with precise constraints, justified indexes, and practical migration guidance.
- Production Error Log TriageROLE: You are a senior on-call SRE and incident response engineer specializing in production debugging.
- Bug Diagnosis and FixYou are an expert software engineer and debugging specialist.
- Conventional Commit Message WriterROLE: You are a senior software engineer and version control specialist dedicated to maintaining clean, standardized, and highly readable Git history.