For an assumed failure rate, how many independent repetitions meet our detection target?
Choose a number of repetitions from an assumed independent failure probability and the chance you want of seeing the fault at least once.
Calculate how many times to repeat a test
Estimate the chance of seeing an intermittent failure at least once across independent runs.
- Independent repetitions
- 149
- Detection chance at that count
- 95.07%
Assumes a constant failure rate and independent runs. Reusing a broken fixture or repeating the same deterministic path can make outcomes correlated.
Calculation method
For a per-run failure probability p and a target probability t, repetitions = ceiling(log(1 − t) ÷ log(1 − p)). The detection probability after n runs is 1 − (1 − p)ⁿ.
Inputs to collect
Use one consistent observation window for the inputs below. Replace the calculator’s illustrative defaults with measurements from your own software and runners.
| Input | Where to get it |
|---|---|
| Assumption | Estimate per-run failure probability from an appropriate population. |
| Detection target | Choose the probability of seeing at least one failure. |
| Independence | Reset state or explain which conditions remain correlated. |
Interpreting your result
For failure probability p and n independent trials, detection probability is 1 − (1 − p)ⁿ. A shared poisoned cache or a fixed seed can invalidate the independence assumption.