Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

What is the difference between defect, and bug?

share|improve this question

closed as primarily opinion-based by gnat, MichaelT, Kilian Foth, Dan Pichelman, ratchet freak Sep 11 at 12:26

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

1  
Read testingstandards.co.uk/bs_7925-1_online.htm for more information –  StuperUser Feb 11 '11 at 14:19
    
There are bugs that actually say that something is missing which means they are feature request, not bugs. –  m3th0dman Jan 21 '13 at 7:59

11 Answers 11

up vote 38 down vote accepted
  • A bug is the result of a coding error

  • A defect is a deviation from the requirements

That is: A defect does not necessarily mean there is a bug in the code, it could be a function that was not implemented but defined in the requirements of the software.


From the Wikipedia page on software testing:

Not all software defects are caused by coding errors. One common source of expensive defects is caused by requirement gaps, e.g., unrecognized requirements, that result in errors of omission by the program designer.[14] A common source of requirements gaps is non-functional requirements such as testability, scalability, maintainability, usability, performance, and security.

share|improve this answer
6  
Both are "deviations from requirements" as I see it. –  Martin Wickman Jan 15 '11 at 22:15
2  
A defect doesn't have to be a bug. Also, a bug doesn't have to mean a requirement was not meet, and hence is not 'a deviation from requirement' –  Dan McGrath Jan 16 '11 at 10:55
    
Plus, there may not have been a requirement that, for example, all the buttons on a screen line up nicely, but someone may well enter a bug if they don't, and the developer will almost certainly be asked to fix it. –  Kate Gregory Jan 16 '11 at 17:17
5  
You seem to be missing the point @Martin. Yes, a bug can be a defect. Yes, a defect can be a bug. But that isn't necessarily always true. Just because there is some overlap, doesn't mean they are identical! Venn Diagram of Bug & Defect -> (()) –  Dan McGrath Jan 16 '11 at 21:25
2  
@Dan McGrath: basically what you did here is your own definition of a bug. But in general there isn't any defined meaning, it's just an engineering jargon! –  MaR Sep 12 '11 at 11:28

There some different terms related to software bugs. Excerpt from a course I took:

  • Error: Human action or omission that results in a fault.

  • Fault: Fault is a software defect (incorrect step, process or data definition) that causes a failure.

  • Bug: Same as Fault.

  • Failure: The inability of a software to perform its required functions within specified performance requirements.

According to this, there is no difference between a defect and a bug. However, some people argue that bug is an error that is found before releasing the software, whereas defect is one found by the customer.

I couldn't resist posting the famous "first actual case of bug being found".

alt text

share|improve this answer
    
Finally, someone who has read: testingstandards.co.uk/bs_7925-1_online.htm –  StuperUser Feb 11 '11 at 14:18
    
That's not where I got it from, but they may have a common source (or this one might be the source). –  Tamás Szelei Feb 13 '11 at 14:32
    
Yup, many, many years ago I spent a while trying to fix a bug. I had some annoying flicker in one cell on the screen and it made no sense. It finally flew off. (This was in the era of white text on a black screen, the spot in question was far enough to the right to always be black while I was editing, thus I only noticed it when the program put some white behind it.) –  Loren Pechtel Sep 7 at 21:46

Defect is an older ubiquitous term related to blemishes in materials of any type of goods.

Bug is a recent term related to programming to denote an immaterial blemish in a computer program.

share|improve this answer
1  
I don't think the term "bug" is only used for immaterial blemishes. It's generally used to define all defects, whether material or immaterial. –  Bryan Oakley Oct 27 '13 at 15:20
    
@BryanOakley Quite, this is why there is Bugzilla, not Defectilla. –  David Tonhofer Sep 7 at 8:52
    
The term "bug" has been used by engineers since at least the 1800s to describe things that don't work properly. –  David K Sep 7 at 14:09

Quoting Ilene Burnstein from the book Practical Software Testing (recommended) who parts from the definition in the "IEEE Standards Collection for Software Engineering" (1994) and "IEEE Standard Glossary of Software Engineering Terminology" (standard 610.12, 1990):

Error

An error is a mistake, misconception, or misunderstanding on the part of a software developer

In the category of developer we include software engineers, programmers, analysts, and testers. For example, a developer may misunderstand a de- sign notation, or a programmer might type a variable name incorrectly.

Faults (Defects)

A fault (defect) is introduced into the software as the result of an error. It is an anomaly in the software that may cause it to behave incorrectly, and not according to its specification.

Faults or defects are sometimes called “bugs.” Use of the latter term triv- ializes the impact faults have on software quality. Use of the term “defect” is also associated with software artifacts such as requirements and design documents. Defects occurring in these artifacts are also caused by errors and are usually detected in the review process.

Failures

A failure is the inability of a software system or component to perform its required functions within specified performance requirements.

During execution of a software component or system, a tester, developer, or user observes that it does not produce the expected results. In some cases a particular type of misbehavior indicates a certain type of fault is present. We can say that the type of misbehavior is a symptom of the fault. An experienced developer/tester will have a knowledge base of fault/symptoms/failure cases (fault models as described in Chapter 3) stored in memory. Incorrect behavior can include producing incorrect values for output variables, an incorrect response on the part of a device, or an incorrect image on a screen. During development failures are usually observed by testers, and faults are located and repaired by developers.

You can read the full chapter in Google Books, here.

share|improve this answer

Oh dear.

Back in the old days - defective operation of a computer was caused by all sorts of things - including rats chewing the wiring and real bugs (critters) getting into the works.

The term BUG has stuck as a term that means something not working as expected.

BUG should be thought of as a jargon term meaning a defect.

A defect is a technically correct term meaning that the thing does not do as it should.

Wherever possible, using DEFECT instead of BUG actually carries with it a connotation that we acknowledge our failures (our defects, our lack of understanding of user requirements or the things we overlooked in implementation) instead of dressing it up as the more trivial sounding "bug".

Use DEFECT.

Try not to use the term BUG. Its silly, irrelevant, historical, and trivialising.

share|improve this answer
1  
Why would you want to remove from use a well understood technical term? I'm sorry... yes, BUG is historical - but if you think that programmers regard bugs (generically as opposed to specific) as trivial just because they're called bugs or the term as irrelevant because of its origins then I'm afraid my turning into a grumpy middle-aged is entirely justified. Oh and as @Dan points out, bugs are defects but defects aren't necessarily bugs, which further suggests that the term has value. –  Murph Jan 15 '11 at 14:54
2  
@Murph, a "bug" is a euphemism for a programming error. Unconsciously this allures to a kind of gremlin that the developer has no control over. This is not correct - it is an error and acknowledging this is a step towards more professional behaviour. (Imho of course :-)) –  rsp Jan 15 '11 at 20:55
1  
Erm, clearly I disagree (-: I know precisely who is responsible for the bugs - coding and logic errors - that I have in my code. (I'm also able to identify failings in other people's code.) All the programmers I know are clear about what the term means - that they (well some programmer) and not some kind of gremlin made a mistake. –  Murph Jan 16 '11 at 0:12
2  
When dealing with your customers you can call these things bugs, or defects. Bugs is jargon. Defects is an acknowledgement, outside the jargon, that its not as it should be. "Defects" is a term that is, and encourages, clear communication - outside the programming fraternity as well as inside. (I also disagree that there is a difference between a bug and a defect.) –  quickly_now Jan 16 '11 at 7:03
    
Defects is the proper term. How many programs are released with bugs in them and we all accept that? But how many programs are released with defects? We wouldn't accept that because the term implies a greater severity and we know that it's our own fault for the error, rather than a bug where we can blame the weather or the time of day. –  omouse Sep 11 '11 at 17:06

The difference is that the term "bug" sound magical. As if a program can randomly have bugs in it after you're done programming. If it has random bugs then it means you didn't conform to the specifications and your program is in error.

A defect means an error where the program doesn't conform to the specifications. This is more severe and basically says, any error is a huge problem with the program and this means that the program is not fit to be released.

The difference is in the attitude of the programmers who use the terms. There are millions of programs that are released with bugs and people are fine with that because they accept for some reason that a bug is magical and random and that every program contains at least one bug. However, a programmer who uses the term "defect" may become uncomfortable with releasing a program with a defect because the term implies a greater severity.

The implications of preferring one term over the other affect us daily.

share|improve this answer

From the IEEE Standard Glossary of Software Engineering Terminology, which is cited in the Software Engineering Body of Knowledge KA for Software Testing and Software Quality:

bug. See: error; fault.


error. (1) The difference between a computed, observed, or measured value or condition and the true, specified, or theoretically correct value or condition. For example, a difference of 30 meters between a computed result and the correct result. (2) An incorrect step, process, or data definition. For example, an incorrect instruction in a computer program. (3) An incorrect result. For example, a computed result of 12 when the correct result is 10. (4) A human action that produces an incorrect result. For example, an incorrect action on the part of a programmer or operator. Note: While all four definitions are commonly used, one distinction assigns definition 1 to the word “error,” definition 2 to the word “fault,” definition 3 to the word “failure,” and definition 4 to the word “mistake.” See a2so: dynamic error; fatal error; indigenous error; semantic error; syntactic error; static error; transient error.


failure. The inability of a system or component to perform its required functions within specified performance requirements. Note: The fault tolerance discipline distinguishes between a human action (a mistake), its manifestation (a hardware or software fault), the result of the fault (a failure), and the amount by which the result is incorrect (the error). See also: crash; dependent failure; exception; failure mode; failure rate; hard failure; incipient failure; independent failure; random failure; soft failure; stuck failure.


fault. (1) A defect in a hardware device or component; for example, a short circuit or broken wire. (2) An incorrect step, process, or data definition in a computer program. Note: This definition is used primarily by the fault tolerance discipline. In common usage, the terms “error” and “bug” are used to express this meaning. See also: data-sensitive fault; program sensitive fault; equivalent faults; fault masking; intermittent fault.


I think the definition of failure is the most relevant. Everything begins with a mistake, whether it's in the requirements, the design, the implementation, or the test case/procedure. If this mistake is manifested in software, it becomes a fault. A failure is caused by the existence of one or more faults in software.

I'm not to keen on the formal definition of error, though. I very much prefer the definition provided by dukeofgaming in his answer, however, the one in this answer is the IEEE standard definition of error.

share|improve this answer

According to Dependability: basic concepts and terminology:

A system failure occurs when the delivered service deviates from fulfilling the system function, the latter being what the system is intended for. An error is that part of the system state which is liable to lead to subsequent failure: an error affecting the service is an indication that a failure occurs or has occurred. The adjudged or hypothesized cause of an error is a fault.

I understand defect as just another name for fault.

Bug is confusing and can represent a fault or a failure depending on the context.

Note that there is no mention of specification: even a spec can be faulty.

share|improve this answer

Dan McGrath's answer nailed it right.

  • A bug is the result of a coding error
  • A defect is a deviation from the requirements

Maybe an example would make it clearer.

Example: Client wanted the web form to be able to save and close the window.

Scenario #1: Web form have a save button, and another close button. Result: Defect, because client wanted the 1 button to save and close the window. Developer misunderstood and created separately. Because both buttons performed their requirements, it is not a bug, but a defect because it didn't meet client's requirement.

Scenario #2: Web form have a save & close button, but only saves but does not close. Result: Bug. Because the button does not perform as required/expected. Developer knows it is suppose to produce that result but ultimately it didn't. (perhaps coding error)

Not sure if this makes it clearer.

p/s: from a developer stand point (I was once), both defects and bugs are just as important. We'll still fix it.

We even encountered weird anomalies, which we categorized under bugs and we continously try to figure out what is the cause and how to fix it. Terming it bugs doesn't make it trivial compared to defects.

share|improve this answer

I believe both are the same and can be used interchangeably. Both defects or bugs are written up by the tester (QA) and assigned to the developers to look at. The developer determines what caused the defect or bug and fixes it as the case may be. The tester retests the defect or bug and verifies that it performs as it should. I am a tester and when my expected result is not what I see, then I say rather gleefully that I have found a bug and I write up a defect for it, the bug gets fixed and I retest to make sure that the bug is gone and I close the defect.

share|improve this answer
3  
is this only your opinion or you can back it up somehow? –  gnat Apr 2 at 19:35
    
@gnat ISTQB Glossary defines it as the same thing. So does daily usage. –  David Tonhofer Sep 7 at 12:09

Here is one I did earlier for my employer Q-LEAP based on the ISTQB vocabulary and I also checked the IEEE vocabulary. Enjoy.

Bug and Defect? The same even though one can have endless discussion about this. We have really other things to worry about, life is complicated enough already, etc.

enter image description here

An example of how the term is used in the wild, from "How Google Tests Software" p. 113. Open an article of "IEEE Software" and it's used the same way. Indeed, one rarely encounters the word "defect" in real life.

Life of a Bug

Bugs and bug reports are the one artifact every tester understands. Finding bugs, triaging bugs, fixing bugs, and regressing bugs are the heartbeat and workflow for software quality. This is the part of testing that is the most conventional at Google, but there are still a few interesting deviations from the norm. For this section, we ignore the bugs that are filed to track work items and use the term to identify actual broken code. As such, bugs often represent the hour-to-hour and day-to-day workflow for engineering teams.

A bug is born. Bugs are found and filed by everyone at Google. Product Managers file bugs when they catch issues in the early builds that differ form their specifications/thoughts. Developers file bugs when they realize they accidentally checked in an issue, or find an issue somewhere else in the codebase, or while dogfooding Google products. Bugs also come in from the field, from crowd-sourced testers, external vendor testing, and are filed by Community Managers monitoring the product-specific Google Groups. Many internal versions of apps also have quick one-click ways to file bugs, like Google maps. And, sometimes, software programs create bugs via an API.

share|improve this answer

protected by gnat Apr 2 at 19:35

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.