Mean time to detect (MTTD)
Mean time to detect (MTTD) is the average time between a defect or incident starting and somebody on the team knowing about it. It is the sum of the detection times for a set of problems divided by the number of problems. Security operations use the same measure for intrusions; in software quality it describes how long faults run unnoticed.
The longer version
The sum needs two timestamps per problem: when it started and when the team became aware of it. Suppose a site had four production defects in a month. A broken discount code went live with a deployment at 09:00 and was noticed at 09:30, which is 30 minutes. A form that failed in one browser took 6 hours to reach the team. A wrong price on a landing page took 20 hours, and an expired certificate was caught by an alert in 10 minutes. In minutes the four are 30, 360, 1,200 and 10, a total of 1,600, and 1,600 divided by 4 gives a mean time to detect of 400 minutes, or 6 hours 40 minutes. Only one of the four took that long. As with any mean, a single slow detection pulls the figure up, so the median, here 195 minutes, is worth reporting beside it.
Where the clock starts is the hard part. Detection time ends at a recorded moment, the alert or the ticket, and begins at a moment nobody recorded, since the fault was not yet known. The start is reconstructed afterwards from the deployment that introduced the defect, the first matching error in the logs or the first affected order. Where that cannot be done the incident is left out of the average and counted separately, because a guess would make the figure look more exact than it is. The figure also flatters by construction. A fault nobody has noticed yet has no detection time and is missing from the average, and a reconstructed start is usually later than the real one, so mean time to detect is a lower bound on how long problems really run. Splitting it by severity keeps a slow week of cosmetic reports from hiding a fast response to outages, or the reverse. The measure sits directly in front of mean time to resolution. Detection covers the stretch from the start of the problem to awareness, resolution covers the stretch from the report to the fix, and the two added together approximate how long users lived with the fault. A team with fast fixes and slow detection reports a short resolution time, and its customers waited all the same.
The same measure is used in security operations, where it means the time between an intrusion beginning and the security team identifying it. The arithmetic is identical, but figures published for that field do not transfer: they describe attackers who are trying to stay hidden, and a broken checkout is not hiding from anyone. For a website the interval shrinks when something is looking at production all the time. A smoke test run after each deployment catches the fault that arrived with the release. Synthetic checks walk the critical paths on a schedule, including at night. Error tracking and real user monitoring report the exceptions and slow pages that real visitors hit. A visible way for visitors and clients to report a problem from the page covers what no script looks for, such as wrong content or a confusing step. Each escaped defect has a detection time of its own, and the long ones show where nothing was watching.
Common questions
What is mean time to detect?
Mean time to detect is the average length of time a problem exists before the team responsible for the system knows about it. The measure is taken over a set of defects or incidents in a period, and it shows how quickly monitoring, checks in production and user reports bring faults to the team's attention.
How do you calculate mean time to detect?
Subtract the time each problem started from the time it was detected, add the results and divide by the number of problems. Three incidents detected after 10, 20 and 60 minutes total 90 minutes, and 90 divided by 3 gives a mean time to detect of 30 minutes. Incidents with an unknown start time are excluded and counted apart.
What is the difference between MTTD and MTTR?
MTTD measures how long a problem runs before the team knows of it, from its start to its detection. MTTR, in the sense of mean time to resolution, measures how long the problem takes to close once it has been reported. One describes the quality of monitoring and reporting and the other the speed of the response, and a team can be good at either without the other.
What is the difference between MTTD and MTTA?
MTTD ends when the problem is detected, usually when an alert fires or a report arrives. MTTA, mean time to acknowledge, starts there and ends when a person accepts the alert or the ticket and starts work on it. A long MTTD points at monitoring that misses things, and a long MTTA at alerts or reports that sit unread.
What is a good mean time to detect?
There is no general benchmark worth quoting, because the figure depends on what is counted, how start times are reconstructed and how severe the problems were. A broken checkout should be detected in minutes and a typo on an old page may reasonably take weeks. Set a target per severity level and compare each month with the previous ones.
Is mean time to detect a security metric or a quality metric?
Mean time to detect is used in both fields with the same formula. Security operations apply it to the gap between a breach starting and its discovery. Software and website teams apply it to defects and outages. Figures from one field say nothing about the other, since the events being timed and the means of noticing them are different.
How can a website team reduce its mean time to detect?
A website team reduces detection time by watching production continuously: a smoke test after every deployment, scheduled synthetic checks on sign-up, checkout and other critical paths, alerts on error rates, real user monitoring, and a feedback route on the page for the faults no monitor recognises. Reviewing the slowest detections each month shows which of those was missing.
Bug reports that arrive ready to triage.
Collect replay, console, network and browser context with the Free plan.