npx skills add ...
npx skills add petrkindlmann/qa-skills --skill risk-based-testing
Produce a risk matrix or heatmap that quantifies what could break by business impact × probability, runs failure mode analysis on the top items, and maps test coverage to risk zones. Includes stakeholder interview frameworks and continuous reassessment. Run this BEFORE test-strategy or test-planning. Use when: "risk assessment," "risk matrix," "risk heatmap," "what could break," "critical paths," "failure modes," "where to focus testing." Not for: multi-quarter QA direction — use test-strategy. Not for: a single sprint/release test plan — use test-planning. Not for: hands-on session-based bug hunting — use exploratory-testing. Related: test-strategy, test-planning, release-readiness, qa-metrics.
npx skills add petrkindlmann/qa-skills --skill risk-based-testing
| Situation | Start at |
|---|---|
| New product, no risk model yet | Phase 1 (Identification) → run the full 6 phases |
| Post-incident reassessment | Phase 6 (Reassessment triggers), then re-score the affected items in Phase 2 |
| AI/LLM feature to assess | Phase 3 (AI/LLM failure classes), score each class in Phase 2 |
| Sprint refresh of an existing matrix | Phases 4–5 (Heatmap + Coverage alignment) on changed features |
| Verify an old heatmap is still true | Phase 6 signals + Anti-Pattern "Risk Theater" |
Check .agents/qa-project-context.md first — if it exists, use it as the foundation and skip questions already answered there. Gather the rest from stakeholders across engineering, product, and operations.
Enumerate everything that could go wrong. Cast a wide net. Sources include:
git log --stat <file> is for per-commit inspection of a specific suspect, not for ranking.Use HTSM v6.3 (Heuristic Test Strategy Model, Bach) as a Phase-1 lens — its state-based and boundary heuristics surface risks a pure feature-list misses. Download: https://www.satisfice.com/download/heuristic-test-strategy-model
Output: a raw list of risk items, each describing what could fail and what the consequence would be.
Categorize each risk item along two axes.
Impact categories (how bad is it):
| Score | Level | Definition | Examples |
|---|---|---|---|
| 5 | Catastrophic | Revenue loss, data breach, legal action, user safety | Payment processing fails, PII exposed |
| 4 | Major | Significant user impact, SLA violation, major feature broken | Login broken for segment, data corruption |
| 3 | Moderate | Workflow disrupted, workaround exists | Search returns wrong results, export fails |
| 2 | Minor | Cosmetic or minor UX issue | Alignment bug, slow non-critical page |
| 1 | Negligible | No user impact, internal only | Admin tooltip wrong, log format issue |
Probability categories (how likely is it):
| Score | Level | Definition | Indicators |
|---|---|---|---|
| 5 | Frequent | Expected in most releases | High code churn, no tests, complex logic |
| 4 | Likely | Will probably happen within a quarter | Recent changes, partial coverage, known tech debt |
| 3 | Possible | Could happen, has happened before | Moderate complexity, some coverage |
| 2 | Unlikely | Improbable but not impossible | Stable code, good coverage, simple logic |
| 1 | Rare | Requires exceptional circumstances | Well-tested, rarely changed, simple |
Composite score = Impact × Probability. Frequent changes indicate defect probability, so a Moderate-impact (3) feature under heavy churn scores Probability 5 → Risk score: 15 → CRITICAL zone, despite "only" moderate impact. The composite score drives priority, not impact alone.
For each high-risk item (score ≥ 10), perform a detailed failure mode analysis.
Example — E-commerce Checkout (Risk Score 20, Impact 5 × Probability 4):
For AI/LLM features, classify against these CT-GenAI classes and score Impact and Probability independently like any other risk. The mitigation is the existence of an automated eval suite, not a single manual test.
AI/LLM-specific failure classes (from ISTQB CT-GenAI v1.1, effective 27 April 2026):
- Hallucination / reasoning error — Impact: moderate to major; Probability: high without explicit prompt-eval coverage. Detection: golden-dataset evals, fact-check assertions (see
ai-system-testing).- Bias — Impact: catastrophic in regulated industries (finance, healthcare, hiring). Probability: dataset-dependent. Detection: counterfactual evals, demographic-parity checks.
- Prompt injection / jailbreak — Impact: major (data exfiltration, prompt extraction). Probability: high for any externally-facing LLM feature. Detection: Garak, PyRIT, Promptfoo redteam.
- Privacy leak — Impact: catastrophic under GDPR/CCPA/EU AI Act. Probability: dataset-dependent. Detection: PII scanning of training data and prompts.
- AI Act / regulatory non-compliance — Impact: catastrophic (fines, ban). Probability: high for EU-facing AI features. Detection: see
compliance-testing.Tool freshness (mid-2026): PyRIT now lives at microsoft/PyRIT — the old Azure-hosted repo was archived March 2026, so do not point new redteam work at the legacy Azure path. Promptfoo was acquired by OpenAI (March 2026) but remains MIT-licensed. Garak is current and unchanged.
Reference frameworks: CT-GenAI v1.1 (ISTQB, effective 27 April 2026) codifies the AI/LLM classes above. WQR 2025-26 (Capgemini, 17th edition, Nov 2025) gives the adoption-stage framing for AI risk planning.
Plot all risk items on a 5×5 matrix to communicate priorities and drive coverage decisions.
Zone boundaries and action mapping:
| Zone | Score Range | Color | Testing Action |
|---|---|---|---|
| CRITICAL | 15-25 | Red | Automate fully + monitor in production + load test + manual exploratory |
| HIGH | 10-14 | Orange | Automate fully + periodic manual review |
| MEDIUM | 5-9 | Yellow | Automate happy path + key error cases |
| LOW | 1-4 | Green | Manual testing on release or skip entirely |
Populated example (where each named risk lands):
Map test density to risk level. Every zone gets a prescribed approach.
| Risk Zone | Unit Tests | Integration Tests | E2E Tests | Manual Testing | Monitoring |
|---|---|---|---|---|---|
| CRITICAL (15-25) | 90%+ branch coverage | All service boundaries | Full user journey + error paths | Exploratory each release | Real-time alerts, synthetic checks |
| HIGH (10-14) | 80%+ branch coverage | Key interactions | Happy path + top 3 error paths | Spot checks | Dashboard + daily review |
| MEDIUM (5-9) | 70%+ branch coverage | Happy path only | Happy path only | On major changes | Weekly review |
| LOW (1-4) | Basic happy path | None required | None required | On initial build | None required |
Compare current coverage against required coverage per risk zone:
A churn signal forces this worksheet open: a module that changed 47 times in 3 months (Probability → 5) with only 40% branch coverage and no integration tests jumps zones (e.g. MEDIUM → HIGH), and the new coverage target is justified by the churn, not picked arbitrarily.
See references/examples.md for four fully-scored examples (checkout, media platform, third-party API, auth) showing the path from risk score to prescribed coverage.
Risk assessment is not a one-time activity. Build reassessment into the team's rhythm.
Reassessment triggers:
Continuous risk signals to monitor:
Applying the same coverage target to every feature regardless of risk. A 90% target on a settings page wastes effort that should go to payments or auth. Let the risk model drive allocation.
Creating a matrix during planning and never updating it. The product, team, and dependencies all change. A model from 6 months ago is outdated and out of date the moment a dependency, feature, or incident shifts the picture — it does not reflect today. Schedule reassessment and enforce it.
Treating bugs caught in staging as pure successes. If a critical bug was caught only by manual testing, the automated safety net has a gap. Document near-misses and adjust the model.
Going through the motions (filling matrices, drawing heatmaps) without changing test allocation. If the heatmap exists but coverage does not align to it, the exercise was wasted. Verify alignment quarterly. Bolton's "Quality Engineering Is Not Testing" (2026-04-20) warns of exactly this — building a heatmap and calling it "QE done." Reference: https://developsense.com/blog/2026/04/quality-engineering-is-not-testing
Over-weighting past incidents and under-weighting new vectors. A module that failed 2 years ago and was since rewritten may no longer be high risk; a brand-new third-party integration has unknown risk that deserves attention.
Severity is how bad a failure is; priority is how urgently to test it. A catastrophic-but-rare failure (earthquake destroys data center) can be lower priority than a moderate-but-frequent one (search occasionally wrong). Use the composite score, not impact alone.
Prove the matrix is real and aligned before calling it done — smallest check first:
git ls-files | grep -E 'risk-matrix|qa-project-context' returns the file. An untracked draft on someone's laptop is not a risk model..agents/qa-project-context.md risk section or a committed risk-matrix.md), with every in-scope feature scored on impact (1-5) and probability (1-5)references/)Failure Mode 1: Payment charge succeeds but order not recorded
Trigger: Race condition between payment API callback and order write
Blast Radius: Individual users; money charged but no order confirmation
Detection Method: Payment reconciliation job (runs hourly), user complaint
Current Mitigation: Idempotency key on payment, retry on order write
Gap: No automated test for the race condition; reconciliation delay is 1 hour
Failure Mode 2: Discount code applies incorrect amount
Trigger: Percentage discount on already-discounted item
Blast Radius: All users with stacked discounts; revenue leakage
Detection Method: Margin monitoring alert (>5% deviation)
Current Mitigation: Unit tests for single discounts
Gap: No tests for discount stacking; no tests for rounding edge cases
Failure Mode 3: Inventory not reserved during checkout
Trigger: Concurrent purchases of last-stock item
Blast Radius: Oversold items, fulfillment failure, customer trust
Detection Method: Fulfillment team discovers during packing
Current Mitigation: Database-level stock check on order creation
Gap: No load test simulating concurrent last-item purchases PROBABILITY
Rare(1) Unlikely(2) Possible(3) Likely(4) Frequent(5)
+----------+-----------+-----------+----------+-----------+
Catastrophic(5) | 5 MED | 10 HIGH | 15 CRIT | 20 CRIT | 25 CRIT |
+----------+-----------+-----------+----------+-----------+
Major(4) | 4 LOW | 8 MED | 12 HIGH | 16 CRIT | 20 CRIT |
I +----------+-----------+-----------+----------+-----------+
M Moderate(3) | 3 LOW | 6 MED | 9 MED | 12 HIGH | 15 CRIT |
P +----------+-----------+-----------+----------+-----------+
A Minor(2) | 2 LOW | 4 LOW | 6 MED | 8 MED | 10 HIGH |
C +----------+-----------+-----------+----------+-----------+
T Negligible(1) | 1 LOW | 2 LOW | 3 LOW | 4 LOW | 5 MED |
+----------+-----------+-----------+----------+-----------+ Rare(1) Unlikely(2) Possible(3) Likely(4) Frequent(5)
Catastrophic(5) Auth bypass Payments fail Checkout crash
Major(4) Data export Search broken User upload
Moderate(3) Report fmt Email deliver Profile edit
Minor(2) Footer link Tooltip text Theme switch
Negligible(1) Admin labelFeature: [name]
Risk Zone: [CRITICAL / HIGH / MEDIUM / LOW] Risk Score: [number]
Required Coverage:
Unit: [target %] Current: [actual %] Gap: [delta]
Integration: [required?] Current: [exists? y/n] Gap: [missing scenarios]
E2E: [required?] Current: [exists? y/n] Gap: [missing flows]
Monitoring: [required?] Current: [exists? y/n] Gap: [missing alerts]
Priority: [P0 / P1 / P2 / P3]
Estimated Effort: [hours / story points]
Owner: [name] Target Sprint: [sprint number]