All Topics  
Software bug

 

   Email Print
   Bookmark   Link

 

Software bug


 
 

A software bug (or just “bug”) is an error, flaw, mistake, failureFacts About Failure

Failure in general refers to the state or condition of not meeting a desirable or intended objective....
, faultFault (technology)

In document ISO/CD 10303-226, a fault is defined as an abnormal condition or defect at the component, equipment, or sub-syst...
 or “undocumented feature” in a computer programComputer program

Most computer programs consist of a list of instructions that explicitly implement an algorithm , another form of computer ...
 that prevents it from behaving as intended (e.g., producing an incorrect result). Most bugs arise from mistakes and errors made by people in either a program's source codeSource code

Source code is any series of statements written in some human-readable computer programming language....
 or its designSoftware architecture

The software architecture of a system comprises its software components, their external properties, and their relationships ...
, and a few are caused by compilerCompiler

A compiler is a computer program that translates text written in a computer language into another computer language ....
s producing incorrect code. A program that contains a large number of bugs, and/or bugs that seriously interfere with its functionality, is said to be buggy. Reports detailing bugs in a program are commonly known as bug reports, fault reports, problem reports, trouble reports, change requests, and so forth.

Effects

Bugs can have a wide variety of effects, with varying levels of inconvenience to the user of the program. Some bugs have only a subtle effect on the program's functionality, and may thus lie undetected for a long time. More serious bugs may cause the program to crashCrash (computing)

A crash in computing is a condition where a program stops performing its expected function and also stops responding to othe...
 or freeze leading to a denial of service. Others qualify as security bugs and might for example enable a malicious user to bypass access controls in order to obtain unauthorized privileges.

The results of bugs may be extremely serious. A bug in the code controlling the Therac-25Therac-25

Therac-25 was a radiation therapy machine produced by Atomic Energy of Canada Limited and CGR of France after the Therac-6 a...
 radiation therapyRadiation therapy

Radiation therapy is the medical use of ionizing radiation as part of cancer treatment to control malignant cells ....
 machine was directly responsible for some patient deaths in the 1980s. In 1996, the European Space AgencyEuropean Space Agency

The European Space Agency , established in 1975, is an inter-governmental organization dedicated to the exploration of space...
's US$1 billion prototype Ariane 5Ariane 5 Overview

Ariane 5 is an European expendable launch system designed to deliver satellites into geostationary transfer orbit and to sen...
 rocket was destroyed less than a minute after launch, due to a bug in the on-board guidance computer program. In June 1994, a Royal Air Force ChinookCH-47 Chinook Summary

The Boeing CH-47 Chinook is a versatile, twin-engine, tandem rotor heavy-lift helicopter....
 crashed into the Mull of Kintyre, killing 29. This was initially dismissed as pilot error, but an investigation by Computer WeeklyComputer Weekly

ComputerWeekly is a computer magazine/newspaper published in the UK by Reed Business Information....
uncovered sufficient evidence to convince a House of LordsHouse of Lords

The House of Lords is the upper house of the Parliament of the United Kingdom....
 inquiry that it may have been caused by a software bug in the aircraft's engine control computerFADEC

FADEC is the acronym for Full Authority Digital Electronics Control....
.

Prevention

Bugs are a consequence of the nature of human factors in the programming task. They arise from oversights made by computer programmers during design, coding and data entry. For example: In creating a relatively simple program to sort a list of words into alphabetical order, one's design might fail to consider what should happen when a word contains a hyphenHyphen

A hyphen is a punctuation mark. It is used both to join words and to separate syllables....
. Perhaps, when converting the abstract design into the chosen programming language, one might inadvertently create an off-by-one errorOff-by-one error

An off-by-one error is a logical error involving the discrete equivalent of a boundary condition....
 and fail to sort the last word in the list. Finally, when typing the resulting program into the computer, one might accidentally type a '<' where a '>' was intended, perhaps resulting in the words being sorted into reverse alphabetical order. More complex bugs can arise from unintended interactions between different parts of a computer program. This frequently occurs because computer programs can be complex — millions of lines long in some cases — often having been programmed by many people over a great length of time, so that programmers are unable to mentally track every possible way in which parts can interact. Another category of bug called a race conditionRace condition

A race condition or race hazard is a flaw in a system or process whereby the output of the process is unexpectedly and...
comes about either when a process is running in more than one threadThread (computer science)

A thread in computer science is short for a thread of execution....
 or two or more processes run simultaneously, and the exact order of execution of the critical sequences of code have not been properly synchronized.

The software industry has put much effort into finding methods for preventing programmers from inadvertently introducing bugs while writing software. These include:

Programming style: While typos in the program code most likely are caught by the compiler, a bug usually appears when the programmer makes a logic error. Various innovations in programming styleProgramming style

Programming style refers to the style used in writing the source code for a computer program....
 and defensive programmingDefensive programming

Defensive programming is a form of defensive design intended to ensure the continuing function of a piece of software in spi...
 are designed to make these bugs less likely, or easier to spot.

Programming techniques: Bugs often create inconsistencies in the internal data of a running program. Programs can be written to check the consistency of their own internal data while running. If an inconsistency is encountered, the program can immediately halt, so that the bug can be located and fixed. Alternatively, the program can simply inform the user, attempt to correct the inconsistency, and continue running.

Development methodologies: There are several schemes for managing programmer activity, so that fewer bugs are produced. Many of these fall under the discipline of software engineeringSoftware engineering Summary

Software Engineering is the discipline of designing, creating, and maintaining software by applying technologies and practi...
 (which addresses software design issues as well.) For example, formal program specificationProgram specification

A program specification is the definition of what a computer program is expected to do....
s are used to state the exact behavior of programs, so that design bugs can be eliminated.

Programming language support: Programming languagesProgramming language

A programming language is an artificial language that can be used to control the behavior of a machine, particularly a compu...
 often include features which help programmers deal with bugs, such as exception handlingException handling

Exception handling is a programming language construct or computer hardware mechanism designed to handle the occurrence of s...
. In addition, many recently-invented languages have deliberately excluded features which can easily lead to bugs. For example, the Java programming languageJava (programming language)

Java is an object-oriented programming language developed by James Gosling and colleagues at Sun Microsystems in the early 1...
 does not support pointer arithmetic.

Debugging


Finding and fixing bugs, or "debugging", has always been a major part of computer programmingComputer programming

Computer programming is the craft of writing a set of commands or instructions that can later be compiled and/or interprete...
. Maurice Wilkes, an early computing pioneer, described his realization in the late 1940s that much of the rest of his life would be spent finding mistakes in his own programs. As computer programs grow more complex, bugs become more common and difficult to fix. Often programmers spend more time and effort finding and fixing bugs than writing new code.

Usually, the most difficult part of debugging is locating the erroneous part of the source codeSource code

Source code is any series of statements written in some human-readable computer programming language....
. Once the mistake is found, correcting it is usually easy. Programs known as debuggerDebugger

A debugger is a computer program that is used to test and debug other programs....
s exist to help programmers locate bugs. However, even with the aid of a debugger, locating bugs is something of an art. It is not uncommon for a bug in one section of a program to cause failures in a completely different section, thus making it especially difficult to track (for example, an error in a graphic renderingRendering (computer graphics)

Rendering is the process of generating an image from a model, by means of software programs....
 routine causing a file I/OInput/output

In computing, Input/output, or I/O, is the collection of interfaces that different functional units of an information proce...
 routine to fail); this is most commonly caused by errors that lead to the corruption of program instructions or variables in memory.

Typically, the first step in locating a bug is finding a way to reproduce it easily. Once the bug is reproduced, the programmer can use a debugger or some other tool to monitor the execution of the program in the faulty region, and find the point at which the program went astray. Sometimes, a bug is not a single flawed instruction, but represents an error of thinking or planning on the part of the programmer. Such logic errorLogic error

In Computer Science, a Logic Error is a bug in a program that causes unexpected results or operation but not failure....
s
require a section of the program to be overhauled or rewritten.

It is not always easy to reproduce bugs. Some bugs are triggered by inputs to the program which may be difficult for the programmer to re-create. One cause of the Therac-25Therac-25

Therac-25 was a radiation therapy machine produced by Atomic Energy of Canada Limited and CGR of France after the Therac-6 a...
 radiation machine deaths was a bug that occurred only when the machine operator very rapidly entered a treatment plan; it took days of practice to become able to do this, so the bug did not manifest in testing or when the manufacturer attempted to duplicate it. Other bugs may disappear when the program is run with a debugger; these are heisenbugs (humorously named after the Heisenberg uncertainty principleUncertainty principle

In quantum physics, the Heisenberg uncertainty principle or the Heisenberg indeterminacy principle the latter name give...
.)

Debugging is still a tedious task requiring considerable manpower. Since the 1990s, particularly following the Ariane 5 Flight 501Ariane 5 Flight 501

Flight 501, which took place on June 4, 1996, was the first test flight of the Ariane 5 expendable launch system....
 disaster, there has been a renewed interest in the development of effective automated aids to debugging. For instance, methods of static code analysisStatic code analysis

Static code analysis is the analysis of computer software that is performed without actually executing programs built from t...
 by abstract interpretationAbstract interpretation Overview

In computer science, abstract interpretation is a theory of sound approximation of the semantics of computer programs, based...
 have already made significant achievements, while still remaining much of a work in progress.

Bug management

It is common practice for software to be released with known bugs that are considered non-critical. While software products contain an unknown number of unknown bugs when shipped, measurements during the testing may provide a statistically reliable estimate of the number of likely bugs remaining. Most big software projects maintain a list of "known bugs". This list inform users about bugs that are not fixed in the current release, or not fixed at all, and often a workaroundWorkaround

A workaround is a bypass of a recognized problem in a system....
 is offered additionally.

There are various reasons for such a list:
  • The developers often don't have time to fix all non-severe bugs.
  • The bug could be fixed in a new version or patchPatch (computing)

    In computing, a patch is a small piece of software designed to update or fix problems with a computer program....
     that is not yet released.
  • The changes to the code required to fix the bug would be large, and would bring with them the chance of introducing other bugs into the system.


Given the above, it is often considered impossible to write completely bug-free software of any real complexity. So bugs are categorized by severity, and low-severity non-critical bugs are tolerated, as they do not impact the proper operation of the system, for the majority of users. NASA's SATCSoftware Assurance Technology Center

The Software Assurance Technology Center is a NASA department founded in 1992 as part of their Systems Reliability and Safe...
 managed to reduce number of errors to fewer than 0.1 per 1000 lines of code but this was not felt to be feasible for any real world projects.

One school of thought, popularized by Eric S. RaymondEric S. Raymond

Eric Steven Raymond , often referred to as ESR, is the author of "The Cathedral and the Bazaar" and the present mainta...
 as Linus's LawLinus's Law

Linus's Law can refer to two notions, both named after Linus Torvalds. ...
 in his essay The Cathedral and the BazaarThe Cathedral and the Bazaar

The Cathedral and the Bazaar is an essay by Eric S....
, holds that popular open-source softwareOpen-source software

Open-source software is computer software whose source code is available under a copyright license that permits users to stu...
 holds a better chance of having few or no bugs than other software, because "given enough eyeballs, all bugs are shallow". This assertion has been disputed, however: computer security specialist Elias LevyElias Levy

Elias Levy, was the moderator of the full disclosure vulnerability mailing list Bugtraq from May 14 1996, until he stepped d...
 wrote that "it is easy to hide vulnerabilities in complex, little understood and undocumented source code," because, "even if people are reviewing the code, that doesn't mean they're qualified to do so."

Security vulnerabilities

Malicious softwareMalware

Malware is software designed to infiltrate or damage a computer system without the owner's informed consent....
 may attempt to exploit known vulnerabilities in a system — which may or may not be bugs. Viruses are not bugs in themselves — they are typically programs that are doing precisely what they were designed to do. However, viruses are occasionally referred to as such in the popular press.

Common types of computer bugs

  • Division by zeroDivide By Zero

    Divide By Zero was a British video game developer....
  • NULL pointer dereference
  • Infinite loopInfinite loop

    An infinite loop is a sequence of instructions in a computer program which loops endlessly....
    s
  • Arithmetic overflowArithmetic overflow

    The term arithmetic overflow or simply overflow has the following meanings....
     or underflowArithmetic underflow

    Arithmetic underflow is a condition that can occur when the result of a floating point operation would be smaller in magnitu...
  • Using an uninitialized variableUninitialized variable

    In computing, an uninitialized variable is a variable that is declared but is not set to a definite known value before it is...
  • Accessing memory not owned
  • Memory leakMemory leak

    In computer science, a memory leak is a particular kind of unintentional memory consumption by a computer program where the ...
     or Handle leakHandle leak

    A handle leak is a type of software bug that occurs when a computer program asks for a handle to a resource but does not fre...
  • Buffer overflowBuffer overflow

    In computer security and programming, a buffer overflow, or buffer overrun, is a programming error which may result in...
  • DeadlockFacts About Deadlock

    A deadlock is a situation wherein two or more competing actions are waiting for the other to finish, and thus neither ever ...
  • Off by one error
  • Race conditionRace condition

    A race condition or race hazard is a flaw in a system or process whereby the output of the process is unexpectedly and...
  • Loss of precision in type conversionType conversion

    In computer science, type conversion or typecasting refers to changing an entity of one datatype into another....
  • Assignment instead of equality test

Bugs in popular culture

  • In the 1968 novel (and the ), a spaceship's onboard computer, HAL 9000HAL 9000

    HAL 9000 is a fictional computer/character in the Space Odyssey series, the first being the novel and film 2001: A Sp...
    , is programmed with two conflicting objectives: to fully disclose all its information, and to keep the true purpose of the flight secret from the crew. This conflict causes HAL to eventually try to kill all the crew members (since, if there were no crew, there would be no contradiction).
  • In the 1984 song 99 Red Balloons (though not in the original German version), "bugs in the software" lead to a computer mistaking a group of balloons for a nuclear missile and starting a nuclear warNuclear warfare

    Nuclear war, or atomic war, is war in which nuclear weapons are used....
    .
  • The 2004 novel The Bug, by Ellen UllmanEllen Ullman

    Ellen Ullman is an American computer programmer and author....
    , is about a programmer's attempt to find an elusive bug in a database application.

See also

  • GlitchGlitch

    A glitch is a short-lived fault in a system....
  • ISO 9126ISO 9126

    ISO 9126 is an international standard for the evaluation of software....
    , which classifies a bug as either a defect or a nonconformity
  • WorkaroundWorkaround

    A workaround is a bypass of a recognized problem in a system....
  • Bug tracking systemBug tracking system Summary

    A bug tracking system is a software application that is designed to help programmers keep track of reported software bugs in...
  • Bit rotBit rot

    Bit rot is a colloquial computing term used either to describe gradual decay of storage media or to facetiously describe the...
  • Anti-patternFacts About Anti-pattern

    Anti-patterns, also referred to as pitfalls, are classes of commonly-reinvented bad solutions to problems....
  • Unusual software bugUnusual software bug

    Unusual software bugs are a class of software bugs that are considered exceptionally difficult to understand and repair....
    s (schroedinbug, heisenbug, Bohr bug, and mandelbug)

External links

  • (Thomas Huckle, TU München)
  • (Peter B. Ladkin et al., Universität Bielefeld)
  • (Barbara Wade Rose, Canadian Coalition for Nuclear Responsibility)
  • (Nachum Dershowitz)
  • (Paul Niquette]
  • The error of this term is elaborated above. (Naval Historical Center)
  • An email from 1981 about Adm. Hopper's bug
  • (Mitch Allen)
  • - This project is to track bugs of popular open source software. (Packages for Fedora available)