You have 45 minutes and a 6-hour suite. What runs?
Question
A Friday hotfix changes tax_calculator.py and POST /v1/checkout to fix EU VAT rounding. One serial CI worker has 45 minutes before deploy; full regression takes 360 minutes (6 hours):
| Suite | Relation to diff | Likelihood (1-5) | Impact (1-5) | Time |
|---|---|---|---|---|
| S1. Core smoke (auth, cart, health) | Entry path to checkout | 3 | 5 | 5 min |
| S2. Checkout & EU VAT math | Direct diff target | 5 | 5 | 18 min |
| S3. Payment & invoice API | Downstream consumer | 4 | 5 | 12 min |
| S4. Refund & credit-note tax | Shares tax_calculator.py | 3 | 4 | 15 min |
| S5. Admin reporting & exports | Untouched | 2 | 3 | 40 min |
| S6. Cross-browser UI matrix | Untouched UI | 1 | 3 | 270 min |
- Which suites run, in what order, and why?
- How do you use the remaining minutes?
- What residual risk do you communicate before deploy?
Show hints (3)
- "SCORE RISK FIRST"
Multiply Likelihood by Impact for each suite (total 81 risk points). Compare
{S1, S2, S3}(35 min) against{S2, S3, S4}(45 min). - "FAIL FAST FIRST"
Put the 5-minute smoke gate (
S1) before longer suites so a broken build fails in 5 minutes instead of 35. - "STATE RESIDUAL RISK"
You still have 10 minutes left, while full
S4takes 15 minutes. Never sign off as "fully tested" without naming what did not run.
Show checked explanation
Run S1 (5 min) -> S2 (18 min) -> S3 (12 min). Those 35 minutes (9.7% of the 6-hour suite) cover 60 of 81 risk points (74.1%), beating every other 45-minute combination. Use the leftover 10 minutes for EU-VAT cases from S4 plus triage buffer, and report untested refunds, S5, and S6 as explicit residual risk.
Checked every risk score, subset sum across all 64 suite combinations (0/1 knapsack under 45 min), coverage percentages, and 2-worker parallel schedule in Python 3.12. Checked by an editor other than the author.
Walkthrough
Risk-based test selection ranks work by Risk = Likelihood x Impact, where Likelihood reflects diff blast radius and defect history, and Impact reflects revenue or customer harm.
| Suite | Risk (L x I) | Time | Risk / min | Decision |
|---|---|---|---|---|
| S1. Core smoke | 15 | 5 min | 3.00 | Run 1st (fail-fast gate) |
| S2. Checkout & EU VAT | 25 | 18 min | 1.39 | Run 2nd (direct diff) |
| S3. Payment & invoice API | 20 | 12 min | 1.67 | Run 3rd (downstream money) |
| S4. Refund & credit-note | 12 | 15 min | 0.80 | Slice EU cases into 10 min left |
| S5. Admin exports | 6 | 40 min | 0.15 | Defer post-deploy |
| S6. Cross-browser UI | 3 | 270 min | 0.01 | Defer to nightly |
Why S1 -> S2 -> S3 wins. Checking all 64 subsets under 45 minutes shows {S1, S2, S3} maximizes risk coverage at 60 / 81 points (74.1%) in 35 minutes (9.7% of 360 min). Dropping S1 to squeeze in S4 ({S2, S3, S4}) fills all 45 minutes yet scores lower (57 / 81 = 70.4%), removes the fail-fast deploy check, and leaves zero triage time.
Execution order matters. Run S1 first: if the build breaks auth or checkout routing, you learn in 5 minutes instead of 35. Then run S2 (direct VAT fix) followed by S3 (downstream billing consumers).
Using the remaining 10 minutes. Full S4 takes 15 minutes, so run only the EU-VAT refund specs touching tax_calculator.py (about 5 min). Keep the last 5 minutes to inspect failures and write the release note.
Explicit residual risk. State three facts in your go/no-go note. First, list what passed (S1, S2, S3, EU refund slice). Second, name what did not run (non-EU refunds in S4, S5 exports, S6 cross-browser UI). Third, pair that with production controls: canary rollout, EU VAT alerts, one-click rollback, and full S4 plus S5 running right after deploy.
Common mistakes
- Running
S5orS6alphabetically or by oldest failure first.S5alone eats 40 of your 45 minutes for just 6 risk points. - Dropping
S1smoke to fit{S2, S3, S4}into 45 minutes. That lowers risk coverage (57 < 60) and leaves zero buffer if a test fails. - Signing off with "QA passed" without listing skipped suites (
S4remainder,S5,S6). Hidden gaps turn surprises into Friday outages. - Ignoring shared helper dependencies like
S4usingtax_calculator.py. Diff-based selection must follow callers, not just edited filenames.
Follow-up questions
- "A second CI worker frees up right as you start. How does your plan change?" Run
S1(5 min) as the fast gate first, then fan out: Worker 1 runsS2(18 min) while Worker 2 runsS3(12 min) then fullS4(15 min). Total wall-clock time is5 + 27 = 32minutes, covering 72 of 81 risk points (88.9%) with 13 minutes left for triage. - "The release manager asks to skip
S3(Payment API) to deploy 12 minutes earlier. How do you respond?" Refuse a silent skip and surface the trade-off in numbers:S3carries 20 risk points (second highest) directly downstream ofPOST /v1/checkout. Skipping it drops coverage from 74.1% to 49.4% (40/81) on a billing path. Offer a 5% canary plus instant rollback only if leadership explicitly accepts that risk. - "How do you prevent this 6-hour bottleneck on future hotfixes?" Tag tests by risk tier and code area (smoke, billing, EU tax) and parallelize
S6cross-browser shards. Map fast suites to changed files so CI picks the right tests automatically under pressure.
What a strong answer covers
Scores every suite by Likelihood x Impact and picks S1 -> S2 -> S3 (35 min, 60/81 risk) over weaker 45-minute mixes. Slices EU cases from S4 with triage buffer, and states residual risk plus canary controls.
Open in interactive practice deck →