Bug vs defect vs error vs failure
Updated 2026-11-13 · 2 min read
Separate a human mistake, a flaw in a work product and an observed failure; see where bug and defect overlap. Includes a comparison table, concrete examples and an interview answer.
The difference in one table
| Aspect | Error | Defect / bug | Failure |
|---|---|---|---|
| Common testing meaning | A human mistake | A flaw in a requirement, design, code or other work product | Observed behaviour deviates from what is required |
| Where it occurs | During thought or action | In a work product | During execution or operation |
| Example | Misread the coupon eligibility rule | Incorrect eligibility condition in code | An excluded item receives a discount |
| Evidence | Investigation into how the mistake happened | Review finding or reproducible defect record | Actual result compared with expected result |
| Relationship | Can introduce a defect | May cause a failure under relevant conditions | Can reveal a defect; needs diagnosis |
Examples
Error: a developer misreads “exclude gift cards” as “include gift cards.” That is the human mistake in this hypothetical example.
Defect or bug: the implementation consequently permits discounts on gift cards. The flawed condition exists even when nobody is using checkout.
Failure: a test buys a gift card with the coupon and observes the forbidden discount. The failure exposes the defect only when the relevant conditions occur. A review could have found the defect without producing this runtime failure.
How to answer in an interview
In testing terminology, an error is a human mistake, a defect is a flaw in a work product, and a failure is an observed deviation during execution. Bug and defect are usually synonyms in day-to-day defect tracking. A misunderstood coupon rule can produce a faulty condition that later gives an excluded item a discount. I report the observed failure and expected behaviour first, then investigate the cause rather than assuming it.
Common confusion
Some teams use “error” for an exception or HTTP error response; state which meaning you intend. There is no universal rule that a bug is found by testers and a defect by customers. Not every observed failure proves an application-code defect: test data, environment and the test itself may need investigation.
Likely follow-up: Does every defect cause a failure on every run? No. A faulty branch may need particular inputs or timing before its effect becomes visible.
This is independent foundation-level learning material, not affiliated with ISTQB.
Quick answers
Can a requirement contain a defect?
Yes. An ambiguous, missing or incorrect requirement can be a defect before implementation starts.
Is an exception always a failure?
No. An expected exception may be part of correct behaviour, such as rejecting invalid input. Compare it with the contract.
Sources
Want a project you can show in interviews?
The portfolio project kit walks you through testing a deliberately buggy app with Selenium or Playwright and API tests, then explaining it. The app itself is free.
