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

Fill in the details

Paste the source code, function, or method you want edge-case tests for.

Specify the testing library or framework (e.g., Jest, Pytest, JUnit, Go testing).

Describe what scenarios or cases your current tests already cover.

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

  1. Fill in the fields above. Required ones are marked with *.
  2. Check the prompt preview: your answers appear highlighted in place.
  3. Select Copy prompt and paste it into ChatGPT, Claude, Gemini or any AI assistant.
See all Software Development & Coding prompts