Computer bugA computer bug is an error or flaw in a computer program that prevents it from working correctly. Bugs arise from mistakes in a program's source code or design. It is said that there are bugs in all useful computer programs, but well-written programs contain relatively few bugs, and these bugs typically do not prevent the program from performing its task. 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 "problem reports", "trouble reports", "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. In some operating systems, such as Microsoft Windows, a single crashing or freezing program may render the computer unusable until it is rebooted (see blue screen of death.) Other bugs lead to security problems; for example, a common type of bug called 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. 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.
EtymologyUsage of the term "bug" to describe inexplicable defects has been a part of engineering jargon for many decades; it may have originally been used in hardware engineering to describe mechanical malfunctions. For instance, in a letter from Edison to an associate in 1878:
Source: Edison to Puskas, 13 November 1878, Edison papers, Edison National Laboratory, U.S. National Park Service, West Orange, N.J., cited in Thomas P. Hughes, American Genesis: A History of the American Genius for Invention, Penguin Books, 1989, on page 75. The invention of the term is often erroneously attributed to Grace Hopper, who publicized the cause of a malfunction in an early electromechanical computer. A typical version of the story is given by this quote:
Hopper was not actually the one who found the insect, as she readily acknowledged. The operators who did find it were familiar with the engineering term and, amused, kept the insect with the notation "First actual case of bug being found." Hopper loved to recount the story. [2] (http://www.jamesshuggins.com/h/tek1/first_computer_bug.htm) Preventing bugsBugs 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 exceed their hrair limit. 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, so that programmers are unable to mentally keep track of every possible way in which different parts can interact. 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:
DebuggingMain article: 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 (eventually) find the problem. However, 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. 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 effective automated aids to debugging. For instance, methods of static analysis by abstract interpretation have already made significant achievements, while still remaining much of a work in progress. List of computer bugsThe following is a list of famous computer bugs: Space exploration
Medical
Computing
Telecommunications
Military
Science fiction
Common types of computer bugs
See alsoExternal links
Categories: Programming | Computer terminology |
|
This article is licensed under the GNU Free Documentation License. It uses material from Wikipedia article. Browse Wikipedia for more information. |