Skip to content
QA Knowledge Hub

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

AspectErrorDefect / bugFailure
Common testing meaningA human mistakeA flaw in a requirement, design, code or other work productObserved behaviour deviates from what is required
Where it occursDuring thought or actionIn a work productDuring execution or operation
ExampleMisread the coupon eligibility ruleIncorrect eligibility condition in codeAn excluded item receives a discount
EvidenceInvestigation into how the mistake happenedReview finding or reproducible defect recordActual result compared with expected result
RelationshipCan introduce a defectMay cause a failure under relevant conditionsCan 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.