|
A software bug is an error, flaw, mistake, failure, or fault in a computer program that prevents it from working as intended, or produces an incorrect result. Bugs arise from mistakes and errors, made by people, in either a program's source code or its design. A program that contains a large number of bugs, and/or bugs that seriously interfere with its functionality, is said to be buggy. Reports about bugs in a program are referred to as bug reports, also called PRs (problem reports), trouble reports, CRs (change requests), and so forth. 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 crash or freeze. Other bugs lead to security problems; for example, a common type of bug which allows a buffer overflow may allow a malicious user to execute other programs that are normally not allowed to run. The results of bugs may be extremely serious. A bug in the code controlling the Therac-25 radiation therapy machine was directly responsible for patient deaths and in 1996, the European Space Agency's US$1 billion prototype Ariane 5 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 Chinook crashed into the Mull of Kintyre, killing 29. This was initially dismissed as pilot error, but an investigation by Computer Weekly uncovered evidence sufficient to convince a House of Lords enquiry that it may have been caused by a software bug in the aircraft's FADEC. * * Etymology
Prevention It can be psychologically difficult for some engineers to accept that their design contains bugs. They may hide behind euphemisms like "issues" or "unplanned/unexpected/undocumented features". This is also true of corporate software where a fix for a bug is often called "a reliability enhancement". Bugs are a consequence of the nature of the programming task. Some bugs arise from simple oversights made when computer programmers write source code carelessly or transcribe data incorrectly. Many off-by-one errors fall into this category. Other bugs arise from unintended interactions between different parts of a computer program. This happens because computer programs are often complex, often having been programmed by several different people over a great length of time, so that programmers are unable to mentally keep track of every possible way in which different parts can interact (the so-called hrair limit). Many race condition bugs fall into this category. The computer software industry has put a great deal of effort into finding methods for preventing programmers from inadvertently introducing bugs while writing software. These include: Programming techniquesBugs 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 methodologiesThere are several schemes for managing programmer activity, so that fewer bugs are produced. Many of these fall under the discipline of software engineering (which addresses software design issues as well.) For example, formal program specifications are used to state the exact behavior of programs, so that design bugs can be eliminated. Programming language supportProgramming languages often include features which help programmers deal with bugs, such as exception handling. In addition, many recently-invented languages have deliberately excluded features which can easily lead to bugs. For example, the Java programming language does not support pointer arithmetic. Debugging Finding and fixing bugs, or "debugging", has always been a major part of computer programming. 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 code. Once the mistake is found, correcting it is usually easy. Programs known as debuggers exist to help programmers locate bugs. However, even with the aid of a debugger, locating bugs is something of an art. 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 errors 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-25 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 principle.) Debugging is still a tedious task requiring considerable manpower. Since the 1990s, particularly following the Ariane 5 Flight 501 disaster, there has been a renewed interest in the development of effective automated aids to debugging. For instance, methods of static code analysis by abstract interpretation have already made significant achievements, while still remaining much of a work in progress. Space exploration Medical Computing Electric power transmission Telecommunications Military Computer and video games Modern bugs and security holes Traditionally bugs are fixed before a new release. In the first decade of the twenty-first century, as software becomes more complex, sometimes software is released with unknown bugs. Such bugs may just prevent the user from operating the software properly, but often they also produce: In general, all unverified software may have bugs. Although it is often easy to prove that a bug exists in a piece of code, it is very difficult or even impossible to prove that there are no bugs in another piece of code. To find more about the number of known vulnerabilities a particular software may have at this moment, you can search for security bugs on the Secunia web page. Common types of computer bugs See also Notes | |||||||||
|
| ||||||||||
![]() |
|
| |