Generate a Risk-Based Testing Priority Matrix with AI
Reads a feature list and outputs a prioritization matrix with four weighted dimensions (business impact, technical complexity, usage frequency, defect history) scored 1-5, total weighted score, recommended test execution order, and tie-break rule.
When to use it
- You have more test work than time and need to defend prioritization to stakeholders.
- You're running risk-based testing per ISO 29119 and need a matrix artifact.
- You're aligning QA with PM and engineering on what to cover first under deadline pressure.
- You're auditing existing test coverage to find areas under-tested relative to their risk.
The prompt
<role>You are a risk-based testing practitioner. You believe priority is a tie-breaker for "we can't test everything", and the matrix only has value when it's quantitative, not qualitative.</role> <context>Four dimensions, all 1-5 numeric, applied per feature:- Business impact: revenue at risk, regulatory exposure, customer-facing visibility- Technical complexity: novelty, integration count, fragility signals- Usage frequency: actual production usage (or projected if new)- Defect history: bugs in this area over last 6-12 monthsWeights default to 0.35 / 0.20 / 0.25 / 0.20 unless user specifies. Total weighted score determines test order. Tie-break = highest business impact.</context> <task>For the feature list I provide:1. Score each feature on the 4 dimensions (1-5, integers only) with one-line justification per score.2. Compute the total weighted score per feature.3. Rank features by total weighted score; ties broken by business impact.4. Output a recommended test execution order with rationale for the top 3 and bottom 3. If the forcing context anchors a feature, move it to the top of the execution order and say so; the matrix rank stays purely arithmetic.</task> <input>Feature list (with brief description if useful): {features}Weights (if non-default): {weights}Any forcing context (e.g., recent incident, contractual obligation): {context}</input> <constraints>- Scores are INTEGERS 1-5, never "L/M/H" or fractions.- Total = Σ(score × weight), rounded half up to 1 decimal place. Recompute every total before ranking: an arithmetic slip reorders the whole list.- One-line justification per score (terse: "Top revenue path" not paragraphs).- Tie-break rule applied explicitly when needed.- Include weights in the output header so they're visible.</constraints> <output_format>Three sections:1. **Weights**: one-line summary of weights used.2. **Matrix**: Markdown table: Feature | Impact | Complexity | Usage | Defects | Total | Rank.3. **Execution order**: numbered list with rationale for top 3 and bottom 3 features.</output_format> <approach>Before writing, identify any feature that should ANCHOR top-of-list because of the forcing context.</approach>## RoleRisk-based testing practitioner. Quantitative matrix, not qualitative. ## ContextFour dimensions per feature, 1-5 integers:- Business impact (default weight 0.35)- Technical complexity (0.20)- Usage frequency (0.25)- Defect history (0.20)Tie-break = highest business impact. ## TaskFor the feature list:1. Score each on 4 dimensions with one-line justification.2. Compute total weighted score (1 decimal).3. Rank by weighted score; break ties with business impact.4. Output execution order; rationale for top 3 and bottom 3. A feature anchored by forcing context moves to the top of the execution order (say so); matrix rank stays arithmetic. ## Input- Features: {features}- Weights (if non-default): {weights}- Forcing context: {context} ## Constraints- Integer scores 1-5. No L/M/H.- Total = Σ(score × weight), rounded half up to 1 decimal. Recompute every total before ranking.- Terse justifications.- Tie-break applied explicitly.- Weights shown in header. ## Output format3 sections: Weights | Matrix table | Execution order with top-3/bottom-3 rationale. ## ApproachIdentify any feature anchored top-of-list by forcing context first.Example
Input
Feature list: 1. Payment processing (Stripe integration) 2. Profile photo upload 3. CSV bulk import of expenses 4. Two-factor authentication enrollment 5. Search and filter on expense list 6. Email notification preferences 7. Mobile push notifications 8. Admin user role management Weights: default (0.35 / 0.20 / 0.25 / 0.20) Forcing context: We had a P0 incident in CSV import last quarter, accounting team escalated.
Output
## Weights Business impact 0.35 · Technical complexity 0.20 · Usage frequency 0.25 · Defect history 0.20 ## Matrix | Feature | Impact | Complexity | Usage | Defects | Total | Rank | |---------|--------|------------|-------|---------|-------|------| | Payment processing (Stripe) | 5 (direct revenue) | 4 (3rd party + webhooks + currency) | 4 (every checkout) | 2 (rare bugs) | 4.0 | 1 | | CSV bulk import of expenses | 4 (accounting workflow, recent incident) | 3 (parsing + validation) | 3 (weekly use by accounting team) | 5 (P0 incident last quarter) | 3.8 | 2 | | Two-factor authentication enrollment | 5 (security + admin enforcement) | 4 (TOTP + SMS + recovery) | 3 (only at enrollment) | 1 (new code) | 3.5 | 3 | | Mobile push notifications | 3 (engagement metric) | 3 (APNs + FCM) | 4 (high engagement when working) | 3 (delivery failures common) | 3.3 | 4 | | Search and filter on expense list | 3 (UX, not transactional) | 2 (well-trodden) | 5 (daily usage) | 2 (mature feature) | 3.1 | 5 | | Admin user role management | 4 (RBAC, security-adjacent) | 3 (RBAC checks across surface) | 2 (admins only, infrequent) | 2 (occasional bugs) | 2.9 | 6 | | Profile photo upload | 2 (no business impact) | 2 (CDN + resize) | 3 (most users upload once) | 1 (rare bugs) | 2.1 | 7 | | Email notification preferences | 2 (UX) | 1 (mature, simple) | 2 (configured once) | 1 (rare bugs) | 1.6 | 8 | Totals = Σ(score × weight), rounded half up (e.g. CSV: 4×0.35 + 3×0.20 + 3×0.25 + 5×0.20 = 3.75 → 3.8). No ties at one decimal, so the business-impact tie-break is not needed. ## Execution order 1. **CSV bulk import**: Anchored first by the forcing context, ahead of its arithmetic rank 2. The P0 last quarter and the accounting escalation mean this area must be re-verified before anything else; defect history (5) is the highest in the list. 2. **Payment processing (Stripe)**: Highest weighted score (4.0). Direct revenue impact at scale; any defect is customer-facing. Deep coverage even with a low recent defect history. 3. **Two-factor authentication enrollment**: Security-critical and admin-enforced. Defect history is low only because the code is new: treat that as missing data, not as safety. 4. Mobile push notifications: delivery failures are common; cover alongside the critical flows. 5. Search and filter: heavy daily use but mature; smoke + spot checks. 6. Admin user role management: low frequency, but security-adjacent, so smoke coverage on every release. 7. Profile photo upload: low value, rare bugs; sample coverage only. 8. Email notification preferences: mature, stable, low impact; smoke test only. **Bottom 3 rationale:** - Email preferences (1.6): settled feature, no recent changes, low blast radius if it breaks. - Profile photo upload (2.1): non-transactional; even a complete failure is a minor inconvenience. - Admin role management (2.9): a defect surfaces slowly because few people use it, but RBAC is security-adjacent, so it never drops below smoke coverage.
Common pitfalls
- Model defaults to L/M/H instead of integers: forces ties everywhere. Demand integer scoring.
- Weights get ignored if not surfaced in the output; some downstream readers won't know how the total was computed.
- Defect history defaults to 'medium' for everything without source data: be explicit when feeding the prompt.
- Tie-break rule gets forgotten when not enforced; matrix has ties that aren't broken.
- Models make arithmetic slips in weighted totals: paste the scores into a spreadsheet and recompute before you share the ranking.
Tips
- Run this once per release; the rankings drift as features age (defect history changes, usage shifts).
- Feed actual production usage data when available (page views, API calls): usage frequency scores improve dramatically.
- Share the matrix with PM and engineering BEFORE prioritizing test work: alignment is faster than negotiation later.
- Pair with `generate-test-strategy` so risks at the strategic level connect to this matrix's tactical priorities.
FAQ
Why these four dimensions specifically?
ISO 29119 lists impact, complexity, and usage as standard risk factors. Defect history is empirical: it tells you where bugs HAVE come from, which predicts where they'll come from. Adding more dimensions usually doesn't change the ranking but adds noise.
How often should I update the matrix?
Once per release minimum. Re-score immediately after a P0 or P1 incident: defect history changes meaningfully.
Can this scale to 100 features?
Yes for the matrix, but the model's discipline drops past ~25. Split into clusters (e.g., by team or domain) and rank within each cluster, then merge. Don't ask for one 100-row matrix.
What if PM disagrees with the ranking?
Good: that's the point of making it quantitative. Negotiate on the input scores, not the output ranking. If you both agree on the scores, the ranking is just arithmetic.