Back to the glossary

Process and automation

Defect

A defect is a flaw in code, hardware or documentation that can cause a system to not work as required. Testing terminology distinguishes it from the error that caused it and the failure it produces.

Also known as: bug, fault, failure, error

Three words for “bug”

In everyday speech everything is a “bug”. For analysis it helps to separate the chain:

  1. Error: a person makes a mistake, for example when reading a requirement or writing the code.
  2. Defect: this creates a flaw in the work product, such as a wrong condition in the code.
  3. Failure: when the flawed part is executed, the system visibly behaves incorrectly.

Not every defect leads to a failure. If the defect sits in code that is never executed, it stays unnoticed until conditions change.

What this means for testing

Dynamic tests find failures and trace them back to the defect. Static tests such as reviews find defects directly, without a failure having to occur.

Good defect reports

A useful defect report describes the observed failure, the expected behaviour, the steps to reproduce it and the exact version of the device under test. Automated tests deliver this information in the test report.