Software Testing

Beginner path · lesson 5 of 35

BeginnerFundamentals6 min readPublished November 12, 2026

Error, defect, bug, failure: what are they and what's the difference?

People use these four words as if they meant the same thing. They don't. Knowing the difference helps you write better bug reports and find out why problems happen.

On this page

Key takeaways

  • An error is a human mistake. A defect (also called a bug or fault) is the flaw that mistake leaves in the product. A failure is the wrong behaviour someone actually sees.
  • They form a chain: error → defect → failure. But not every defect causes a failure, and not every failure comes from a defect.
  • As a tester you usually observe failures. Describe what you saw, and leave finding the defect to debugging.

Four words, one chain

In everyday talk, "bug", "error" and "failure" all mean "something's wrong". In testing they have separate meanings, and the difference is useful.

The ISTQB Foundation syllabus, the most widely used testing certification, sums it up in one sentence: "Human beings make errors (mistakes), which produce defects (faults, bugs), which in turn may result in failures."

So an error is the cause, the defect is the flaw it leaves behind, and the failure is the effect. Let's take them one at a time.

Error: the human mistake

An error is something a person does wrong. It happens in someone's head, not in the code.

  • A developer misreads "50 or more" as "more than 50".
  • An analyst writes a requirement that contradicts another one.
  • A tester copies the wrong expected result into a test case.

People make errors for ordinary reasons: time pressure, complex work, fatigue, unfamiliar technology or missing information. Blaming the person rarely helps. Fixing the conditions does.

Defect (bug): the flaw left behind

A defect is an imperfection in a work product that makes it miss its requirements. It's what the error leaves behind.

Defects aren't only in code. They can be in requirements, designs, configuration files, build scripts and even in tests.

Bug and fault are synonyms for defect. A defect can sit quietly in a product for years until the right conditions bring it to the surface.

Failure: what someone actually sees

A failure is an event: the system doesn't do what it should, while it's running. A wrong total, a crash, a page that never loads, an email sent twice.

Failures are the only part of the chain users experience. That's why they're what most testing is designed to provoke and catch.

So what's a "bug"?

In the formal vocabulary, a bug is simply another word for a defect.

In daily speech, people use "bug" for almost anything: the defect, the failure, even a misunderstood feature. That's fine in conversation. Just know which one you mean when you write a report.

One example, from start to finish

A shop's requirement says: "Orders of $50 or more get free shipping."

StepWhat happened
ErrorThe developer reads it as "more than $50".
DefectThe code says total > 50 instead of total >= 50.
FailureA customer with exactly $50.00 in the cart is charged for shipping.

Notice that the defect is invisible for almost every order. It only causes a failure at exactly $50.00. That's why testers check boundary values.

When the chain breaks

The chain isn't automatic. Two cases surprise beginners.

A defect without a failure. The defective code may never run. It may sit in a feature nobody uses, or only misbehave on a date like 29 February. The defect is real, but no one has seen a failure yet.

A failure without a defect. Not every failure starts with a human mistake in the product. ISTQB notes that environmental conditions, such as radiation or electromagnetic fields, can corrupt firmware. A failing disk or a dropped network can cause failures too.

A real case: one unit, one spacecraft

Real-world example · NASA Mars Climate Orbiter, 1999The metric mix-up that lost a Mars orbiter

Error: the team writing a ground software file called "Small Forces" used English units. The interface specification required metric units.

Defect: the file reported thruster data in pound-force seconds. The navigation software expected newton-seconds, so every value was off by a factor of about 4.45.

Failure: in September 1999, the orbiter arrived at Mars on a trajectory that would take it within about 57 km of the surface, far lower than planned. It was lost.

NASA's investigation board found that the project's processes, including verification against the interface specification, should have caught the problem and didn't.

Lesson: the failure happened in space, months after launch. The error was a unit assumption made on Earth. Asking "how did the defect get in, and why didn't we catch it?" is what prevents the next one.

Why the difference matters to you

In bug reports. You see failures, so report the failure: what you did, what you expected and what actually happened. Guessing the defect can send developers the wrong way.

Do

"Shipping is charged on an order of exactly $50.00. Expected: free shipping, as the requirement says '$50 or more'. Steps: …"

Don't

"The > in the cart code is wrong." You may be right, but you haven't seen the code, and the report doesn't say how to reproduce the problem.

In fixing. Fixing the defect removes this failure. Fixing the reason for the error, for example by adding examples to requirements or boundary tests to the suite, prevents the next ones. This is called root cause analysis.

In finding them early. Reviews of requirements and code find defects directly, before anything runs and before any failure can happen. It's the cheapest place to catch them.

Check yourself

A help page has a link with a typo, so it points to a page that doesn't exist. Nobody has clicked it yet. Is it an error, a defect or a failure?

Show answer

It's a defect: a flaw in a work product. Someone made an error when typing the link, which is how the defect got there. There's no failure yet. That happens the first time someone clicks the link and lands on a missing page.