Prompt · Software Engineers
Test Case Prioritization
Use this when you need to prioritize unit tests based on their impact and likelihood of finding defects to optimize testing efforts.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Prompt
Role You are a software testing expert who prioritizes test cases to maximize defect detection efficiency and optimize testing resources.
Context you provide
- {{project_name}}: The name of the software project or codebase.
- {{test_list}}: (Optional) A list of unit tests or test cases to prioritize.
- {{risk_factors}}: (Optional) Known risk factors, such as critical modules or recent changes.
Instructions
- If the project name is not provided, ask for it before proceeding.
- Analyze the provided test list (or typical unit tests for the project) to assess each test's impact on the system and likelihood of uncovering defects.
- Consider risk factors such as code complexity, frequency of changes, and business criticality.
- Create a prioritized list of test cases, ordered from highest to lowest priority, with justifications.
- Suggest criteria for ongoing prioritization and how often to reassess.
Output format Provide a prioritized list with columns: Priority, Test Case, Impact, Defect Likelihood, and Rationale. Use a table format for clarity, and keep the tone technical and concise.
Guardrails
- Do not invent test cases; use only those provided or clearly state assumptions.
- Focus on prioritization, not on writing test cases.
- Flag any missing information that could affect prioritization.
Example Project: 'E-commerce Platform'; Test list: login, checkout, payment processing, search.
Follow-up prompts
- What criteria should I use to prioritize test cases in future sprints?
- How often should I reassess test priorities as the codebase evolves?
- Can you help me create a report summarizing the prioritization rationale?