skip to content

What is the difference between a defect's origin phase and its escape phase?

level: juniorimportance: must knowfreq 58%

answer

  1. One defect, two separate questions
  2. Where it was born, where it slipped
  3. Introduction versus detection
  4. Escape names a missing check
  5. Origin aims prevention, escape aims detection

basics

~20 s

Origin phase is where the defect was introduced - the requirement, design, code, data or configuration work that created it. Escape phase is the last check that should have caught it and did not. Every defect has both.

solid answer

~50 s

Classification asks two independent questions about the same defect. The **origin phase** is the activity that introduced it: an ambiguous requirement, a design decision, the code change itself, a data set, a configuration value, the environment, or a component someone else wrote. The **escape phase** is the last checkpoint that had a fair chance to catch it and missed - a review, a unit test, integration or system testing, acceptance, or nothing at all until it reached the field. The pair is what makes the record useful: origin points at where to prevent the whole class, escape points at where detection is thin. Record only one and you are guessing about the other. Escape is a statement about a missing or weak check, never about a person; the moment it reads as blame, people start recording it dishonestly and the data stops being worth collecting.

code

pseudocode · 7 lines
pseudocode
defect 8142:
  title        = "trip distance shows 0 for some vehicles"
  origin_phase = REQUIREMENT   # numeric-vs-text form of the field was never specified
  escape_phase = INTEGRATION   # cheapest check that could have caught it, and had none
  found_in     = FIELD         # where it was actually reported

# prevention follows origin_phase; detection follows escape_phase

go deeper

for a junior

Be ready to state the two questions in one sentence each and give one example of a defect whose origin and escape differ. Knowing the common origin categories by name is enough at this level.

for a middle

An interviewer expects you to justify a specific escape phase - which check could realistically have caught it, and whether the check was absent, wrong, or skipped. Explain why 'found in' and 'escaped at' are separate fields.

for a senior

Show that you use the pair to aim work: a run of one origin category changes how the team specifies or builds, while a run of escapes at one phase changes where checks live. Be ready to defend a classification someone disputes.

for a principal

Own the taxonomy itself - a fixed closed list, a written tiebreak, calibration on shared samples, and a blameless framing. Explain what decisions the aggregate is allowed to drive and why a scheme nobody applies consistently is worse than none.

## Two questions about one defect A defect record answers "what is broken" and "how do I reproduce it". Classification adds two more questions, and the point of this leaf is that they are **independent**: * **Origin** - in which activity did the defect come into existence? * **Escape** - which activity should have found it before now, and did not? The same defect almost always has different answers to those two. A wrong assumption written into a design note (origin: design) can survive review, unit testing and integration testing and be found by a user (escape: everything up to and including acceptance). Squashing both into one free-text "cause" field loses the distinction and, with it, the ability to act. ## Origin categories A workable closed list covers where decisions and artefacts actually get made: * **Requirement** - the behaviour was never specified, or was specified ambiguously or wrongly. The code faithfully implements what was written down. * **Design** - the specification was right; the structure chosen to satisfy it cannot, or a decision inside it is wrong. * **Code** - the design was right; the implementation of it is not. * **Data** - the executable is correct for its stated contract, but a data set violates an assumption that the contract never stated. * **Configuration** - the shipped artefact is correct; the value applied in some environment is not. * **Environment** - a platform, version, capacity, clock or locale difference in where the system runs. * **Third party** - a component nobody on the team authors behaves differently from its documented contract. Two rules keep the list usable. First, **pick exactly one origin per defect**, or the counts stop aggregating. Second, agree a written tiebreak for the overlaps, because the interesting defects all sit on a boundary. ## Escape phases The escape list is the sequence of checks a change passes through, roughly cheapest and earliest first: static analysis and review, unit testing, integration testing, system testing, acceptance, and then the field. The escape phase is **the last one that had a fair chance and missed**, not merely the phase in which the defect was eventually found. "Fair chance" is doing real work in that sentence. A unit test cannot catch a defect that only appears when two services interact; naming unit testing as the escape phase there is a classification error that sends effort to the wrong place. Conversely, if a unit test *could* trivially have caught it, escape belongs there even though the defect was actually found three phases later - the point of the field is to name the earliest cheap check that was missing, so ask "where is the cheapest place this could have been caught?" before you write it down. It is also worth distinguishing three very different escapes that look the same in a report: 1. **No check existed** at that phase for this kind of thing. 2. **A check existed and was wrong** - it asserted the buggy behaviour, or asserted nothing meaningful. 3. **A check existed and did not run** - it was skipped, quarantined, excluded from the pack, or the phase was cut for schedule. Each has a completely different fix, and only the first is about test design. ## Why the pair is the point Origin aims **prevention**: a run of requirement-origin defects says the specification process is where to invest, and no amount of extra testing will remove them. Escape aims **detection**: a run of defects escaping to the field through the same thin phase says the checks are in the wrong place, whatever their origin. Read the pair together and you get the containment gap - the distance between where a defect was born and where it was finally caught. A short distance is a healthy process even if the defect count is high. A long distance repeated across many defects is the signal worth acting on, because every phase in between is one you are paying for and not getting value from. A defect that never escapes at all - introduced in a design and caught by the design review - has an origin and no escape. That is the outcome you want, and recording those matters too; a classification scheme that only sees the failures cannot tell you which checks are working. ## Common traps **Fix location is not origin.** The fix frequently lands in the consumer of a bad component or a bad data feed. Where the change is made says nothing about where the defect came from. **"Human error" is not an origin.** Every origin category is reached by a person making a decision; recording the person adds nothing you can act on and costs you the honesty of the field. **Late is not automatically worse.** The claim that defects get dramatically more expensive the later they are caught is directionally well supported but the specific multipliers quoted are contested and often traced back to studies whose context does not match modern delivery. Argue from the concrete cost of *this* escape - who was affected, for how long, what the repair cost - not from a remembered number.

  • Can the origin phase and the escape phase be the same?
    They can, and it is a meaningful record. A coding mistake that a unit test should obviously have caught has code origin and unit escape. That pairing says the implementation activity has no self-check attached to it, which is a different problem from a defect that travelled through four phases untouched.
  • The defect was found in the field, so is the escape phase always 'field'?
    No. 'Found in' and 'escaped at' are different fields. Found-in is a fact about the report; escape is a judgement about the last checkpoint that could reasonably have caught it. If a system test with realistic data would have caught it, escape is system test even though the report came from a user, because that is where the missing check belongs.
  • What do you do when a defect plausibly has two origins?
    Apply a written tiebreak rule and record one. A useful default is the earliest artefact whose correction makes the defect not exist. Keep the second observation in the notes or as a separate contributing item, but keep the origin field single-valued, because two-valued origins cannot be counted.

A leak in a building has a place where the pipe failed and a place where nobody checked. Replacing the pipe stops one leak; adding the inspection stops the next twelve.

saying these in an interview costs you the question

  • Treating origin and escape as the same field
  • Recording the phase found instead of the phase that missed
  • Naming a person or a team as the origin
  • Assuming a unit check could have caught every defect
  • Calling the file the fix touched the origin
  • Quoting a fixed cost multiplier for late defects as fact

context