Case study

Bug-fix times

Model how long a bug takes to fix, set aside a model that looks plausible and is not, and budget a sprint with the central limit theorem.

Draws on 4. The uniform distribution, 9. The exponential distribution, 10. Sampling distributions and the CLT

Step 1The question

A software team records how long each bug takes to fix (the lab's bug-fix-times.csv, 2,000 fixes). The team lead wants to plan: how long does a typical fix take, and how many hours should a sprint of 40 bugs be given?

Step 2Choosing the model

Every fix took between 1 and 5 hours, and the histogram is flat: a continuous uniform, U(1, 5). An exponential with the same mean looks plausible for a waiting time and fits badly (chapter 9): it expects many fixes under an hour and some over 5 hours, and there are none.

2,000 values · mean 2.9655 · standard deviation 1.1351 · fitted U(1, 5)

Open in the data-fit labDownload bug-fix-times.csv
2,000 bug-fix times with the uniform U(1, 5)

A fix within 3 hours

Under U(1, 5), what is the probability that a fix takes at most 3 hours?

Your answer
A decimal or a fraction; within 0.0001 of the answer counts as right.

More than 2 hours

Under U(1, 5), what is the probability that a fix takes more than 2 hours?

Your answer
A decimal or a fraction; within 0.0001 of the answer counts as right.

Step 3A sprint of 40 bugs

The total time for 40 fixes is a sum, and by the CLT it is close to normal: its mean is \(40 \times 3 = 120\) hours and its standard deviation \(\sqrt{40} \times 1.1547 = 7.303\) hours, where 1.1547 is the uniform's \(\tfrac{4}{\sqrt{12}}\).

A sprint's budget

How many hours should a sprint of 40 bugs be given, so that the fixes fit in the budget with probability 0.95 (the 95th percentile of the total, to four decimals)?

Your answer
A decimal or a fraction; within 0.0001 of the answer counts as right.

A budget of 132 hours covers the sprint 19 times in 20. Planning every fix at its own 95th percentile, 4.8 hours, would ask for 192 hours, far too many: in a total, long and short fixes cancel out, which is why the spread of a sum grows only with \(\sqrt{40}\).

Try this Watch the means of samples from a flat population pile up into a narrow bell.
Remember: Fix times are flat between 1 and 5 hours: U(1, 5), not an exponential. A single fix is unpredictable, but the total for 40 is close to \(N(120, 7.303)\), so 132 hours covers a sprint with probability 0.95.
Case-study workshop · step 3 of 4

Bug-fix times

A flat model for single fixes, then the CLT for the total of a sprint of 40. Ask why the exponential was set aside, and why a budget for 40 bugs can be far tighter, per bug, than a promise about one.

All steps
An unhandled error has occurred. Reload ๐Ÿ—™

Reconnecting…

Your connection to Introduction to Probability Lab dropped, probably a Wi-Fi blip. Hold on while it reconnects.

The connection could not be restored. The page will reload in a few seconds.