Is a Failing Nightly Regression Test a Real Bug or a Flake
Last updated: November 29, 2026
Quick Overview
A nightly test catches a real regression 95% of the time and fails spuriously 5% of the time on correct code; about 2% of submissions introduce a regression. Given a failure, how likely is a real bug, and how does a rerun that fails again or passes change that?
MathWorks
November 29, 20260
0
0 solved
A nightly test catches a real regression 95% of the time and fails spuriously 5% of the time on correct code; about 2% of submissions introduce a regression. Given a failure, how likely is a real bug, and how does a rerun that fails again or passes change that?
MathWorks runs very large nightly test suites across MATLAB and Simulink, and engineers constantly triage failures as real or flaky. This question checks Bayes' rule with a low base rate and sequential updating, framed in a way the interviewer actually deals with.
What the Interviewer Expects
- Writes Bayes' rule with prior, likelihood and evidence explicitly
- Notices the low base rate makes a single failure only weak evidence
- Updates correctly for a second independent run
- States the independence assumption and when it fails
- Turns the numbers into a triage policy
Key Topics to Cover
How to Approach This
- Define your hypotheses (H0 and H1) clearly before performing any test.
- Calculate required sample size BEFORE running an experiment, using power analysis.
- Remember the Central Limit Theorem: sample means become approximately normal with large n.
- Watch for Simpson's paradox. Always segment data by key dimensions.
- Distinguish between statistical significance and practical significance.
Possible Follow-up Questions
- Flakes are often correlated with the machine or time of day. How does correlation between reruns change the conclusion?
- How would you estimate the flake rate per test from historical pass and fail data?
- If reruns cost 20 minutes of lab time, how many reruns would you schedule before paging the submitter?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Browse Statistics QuestionsSample Answer
Clarify
Let be 'the change introduced a regression'. Given , , . Assume reruns are independent given the true state of the code, and a real regres...
Approach
Apply Bayes' rule once for the first failure, then again treating the posterior as the new prior (or multiply likelihoods for both runs at once)....