Bug (programming)
   HOME

TheInfoList



OR:

A software bug is a design defect ( bug) in
computer software Software consists of computer programs that instruct the Execution (computing), execution of a computer. Software also includes design documents and specifications. The history of software is closely tied to the development of digital comput ...
. A
computer program A computer program is a sequence or set of instructions in a programming language for a computer to Execution (computing), execute. It is one component of software, which also includes software documentation, documentation and other intangibl ...
with many or serious bugs may be described as ''buggy''. The effects of a software bug range from minor (such as a misspelled word in the
user interface In the industrial design field of human–computer interaction, a user interface (UI) is the space where interactions between humans and machines occur. The goal of this interaction is to allow effective operation and control of the machine fro ...
) to severe (such as frequent crashing). In 2002, a study commissioned by the US
Department of Commerce The United States Department of Commerce (DOC) is an United States federal executive departments, executive department of the Federal government of the United States, U.S. federal government. It is responsible for gathering data for business ...
's
National Institute of Standards and Technology The National Institute of Standards and Technology (NIST) is an agency of the United States Department of Commerce whose mission is to promote American innovation and industrial competitiveness. NIST's activities are organized into Outline of p ...
concluded that "software bugs, or errors, are so prevalent and so detrimental that they cost the US economy an estimated $59 billion annually, or about 0.6 percent of the gross domestic product". Since the 1950s, some computer systems have been designed to detect or auto-correct various software errors during operations.


History


Terminology

''Mistake metamorphism'' (from Greek ''meta'' = "change", ''morph'' = "form") refers to the evolution of a defect in the final stage of software deployment. Transformation of a ''mistake'' committed by an analyst in the early stages of the software development lifecycle, which leads to a ''defect'' in the final stage of the cycle has been called ''mistake metamorphism''. Different stages of a mistake in the development cycle may be described as mistake,anomaly, fault, failure, error, exception, crash, glitch, bug, defect, incident, or side effect.


Examples

Software bugs have been linked to disasters. * Software bugs in the Therac-25 radiation therapy machine were directly responsible for patient deaths in the 1980s. * In 1996, the
European Space Agency The European Space Agency (ESA) is a 23-member International organization, international organization devoted to space exploration. With its headquarters in Paris and a staff of around 2,547 people globally as of 2023, ESA was founded in 1975 ...
'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 1994, an RAF Chinook helicopter crashed, killing 29; was initially blamed on pilot error, but was later thought to have been caused by a software bug in the engine-control computer. * Buggy software caused the early 21st century British Post Office scandal.


Controversy

Sometimes the use of ''bug'' to describe the behavior of software is contentious due to perception. Some suggest that the term should be abandoned; contending that ''bug'' implies that the defect arose on its own and push to use ''defect'' instead since it more clearly indicates they are caused by a human. Some contend that ''bug'' may be used to cover up an intentional design decision. In 2011, after receiving scrutiny from US Senator
Al Franken Alan Stuart Franken (born May 21, 1951) is an American politician, comedian, and actor who served from 2009 to 2018 as a United States senator from Minnesota. A member of the Democratic Party (United States), Democratic Party, he worked as an ...
for recording and storing users' locations in unencrypted files, Apple called the behavior a bug. However, Justin Brookman of the
Center for Democracy and Technology Center for Democracy & Technology (CDT) is a Washington, D.C.–based 501(c)(3) nonprofit organization that advocates for digital rights and freedom of expression. CDT seeks to promote legislation that enables individuals to use the Internet for ...
directly challenged that portrayal, stating "I'm glad that they are fixing what they call bugs, but I take exception with their strong denial that they track users."


Prevention

Preventing bugs as early as possible in the
software development process In software engineering, a software development process or software development life cycle (SDLC) is a process of planning and managing software development. It typically involves dividing software development work into smaller, parallel, or s ...
is a target of investment and innovation.


Language support

Newer
programming language A programming language is a system of notation for writing computer programs. Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
s tend to be designed to prevent common bugs based on vulnerabilities of existing languages. Lessons learned from older languages such as
BASIC Basic or BASIC may refer to: Science and technology * BASIC, a computer programming language * Basic (chemistry), having the properties of a base * Basic access authentication, in HTTP Entertainment * Basic (film), ''Basic'' (film), a 2003 film ...
and C are used to inform the design of later languages such as C# and
Rust Rust is an iron oxide, a usually reddish-brown oxide formed by the reaction of iron and oxygen in the catalytic presence of water or air moisture. Rust consists of hydrous iron(III) oxides (Fe2O3·nH2O) and iron(III) oxide-hydroxide (FeO(OH) ...
. A compiled language allows for detecting some typos (such as a misspelled identifier) before runtime which is earlier in the
software development process In software engineering, a software development process or software development life cycle (SDLC) is a process of planning and managing software development. It typically involves dividing software development work into smaller, parallel, or s ...
than for an interpreted language. Languages may include features such as a static
type system In computer programming, a type system is a logical system comprising a set of rules that assigns a property called a ''type'' (for example, integer, floating point, string) to every '' term'' (a word, phrase, or other set of symbols). Usu ...
, restricted
namespace In computing, a namespace is a set of signs (''names'') that are used to identify and refer to objects of various kinds. A namespace ensures that all of a given set of objects have unique names so that they can be easily identified. Namespaces ...
s and
modular programming Modular programming is a software design technique that emphasizes separating the functionality of a program into independent, interchangeable modules, such that each contains everything necessary to execute only one aspect or "concern" of the d ...
. For example, for a typed, compiled language (like C): float num = "3"; is syntactically correct, but fails type checking since the right side, a string, cannot be assigned to a float variable. Compilation fails forcing this defect to be fixed before development progress can resume. With an interpreted language, a failure would not occur until later at runtime. Some languages exclude features that easily lead to bugs, at the expense of slower performance the principle being that it is usually better to write simpler, slower correct code than complicated, buggy code. For example,
Java Java is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea (a part of Pacific Ocean) to the north. With a population of 156.9 million people (including Madura) in mid 2024, proje ...
does not support pointer arithmetic which can be very fast but may lead to memory corruption or segmentation faults if not used with great caution. Some languages include features that add runtime overhead in order to prevent common bugs. For example, many languages include runtime
bounds checking In computer programming, bounds checking is any method of detecting whether a variable is within some bounds before it is used. It is usually used to ensure that a number fits into a given type (range checking), or that a variable being used as ...
and a way to recover from out-of-bounds errors instead of crashing.


Techniques

Style guidelines and defensive programming can prevent easy-to-miss typographical errors (typos). For example, most C-family programming languages allow the omission of braces around an instruction block if there's only a single instruction. The following code executes function only if is true: if (condition) foo(); But this code always executes : if (condition); foo(); Using braces - even if they're not strictly required - reliably prevents this error: if (condition) Enforcement of conventions may be manual (i.e. via
code review Code review (sometimes referred to as peer review) is a software quality assurance activity in which one or more people examine the source code of a computer program, either after implementation or during the development process. The persons perf ...
) or via automated tools such as linters.


Specification

Some contend that writing a
program specification In computer science, formal specifications are mathematically based techniques whose purpose is to help with the implementation of systems and software. They are used to describe a system, to analyze its behavior, and to aid in its design by verify ...
, which states the intended behavior of a program, can prevent bugs. Others, however, contend that formal specifications are impractical for anything but the shortest programs, because of problems of
combinatorial explosion In mathematics, a combinatorial explosion is the rapid growth of the complexity of a problem due to the way its combinatorics depends on input, constraints and bounds. Combinatorial explosion is sometimes used to justify the intractability of cert ...
and indeterminacy.


Software testing

One goal of
software testing Software testing is the act of checking whether software satisfies expectations. Software testing can provide objective, independent information about the Quality (business), quality of software and the risk of its failure to a User (computin ...
is to find bugs. Measurements during testing can provide an estimate of the number of likely bugs remaining. This becomes more reliable the longer a product is tested and developed.


Agile practices

Agile software development Agile software development is an umbrella term for approaches to software development, developing software that reflect the values and principles agreed upon by ''The Agile Alliance'', a group of 17 software practitioners, in 2001. As documented ...
may involve frequent software releases with relatively small changes. Defects are revealed by user feedback. With
test-driven development Test-driven development (TDD) is a way of writing source code, code that involves writing an test automation, automated unit testing, unit-level test case that fails, then writing just enough code to make the test pass, then refactoring both the ...
(TDD), unit tests are written while writing the production code, and the production code is not considered complete until all tests have been written and complete successfully.


Static analysis

Tools for
static code analysis In computer science, static program analysis (also known as static analysis or static simulation) is the analysis of computer programs performed without executing them, in contrast with dynamic program analysis, which is performed on programs duri ...
help developers by inspecting the program text beyond the compiler's capabilities to spot potential problems. Although in general the problem of finding all programming errors given a specification is not solvable (see
halting problem In computability theory (computer science), computability theory, the halting problem is the problem of determining, from a description of an arbitrary computer program and an input, whether the program will finish running, or continue to run for ...
), these tools exploit the fact that human programmers tend to make certain kinds of simple mistakes when writing software.


Instrumentation

Tools to monitor the performance of the software as it is running, either specifically to find problems such as bottlenecks or to give assurance as to correct working, may be embedded in the code explicitly (perhaps as simple as a statement saying PRINT "I AM HERE"), or provided as tools. It is often a surprise to find where most of the time is taken by a piece of code, and this removal of assumptions might cause the code to be rewritten.


Open source

Open source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use and view the source code, design documents, or content of the product. The open source model is a decentrali ...
development allows anyone to examine source code. A school of thought popularized by Eric S. Raymond as Linus's law says that popular
open-source software Open-source software (OSS) is Software, computer software that is released under a Open-source license, license in which the copyright holder grants users the rights to use, study, change, and Software distribution, distribute the software an ...
has more 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 Levy 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." An example of an open-source software bug was the 2008 OpenSSL vulnerability in Debian.


Debugging

''Debugging'' can be a significant part of the software development lifecycle.
Maurice Wilkes Sir Maurice Vincent Wilkes (26 June 1913 – 29 November 2010) was an English computer scientist who designed and helped build the EDSAC, Electronic Delay Storage Automatic Calculator (EDSAC), one of the earliest stored-program computers, and ...
, an early computing pioneer, described his realization in the late 1940s that “a good part of the remainder of my life was going to be spent in finding errors in my own programs”. A program known as a
debugger A debugger is a computer program used to test and debug other programs (the "target" programs). Common features of debuggers include the ability to run or halt the target program using breakpoints, step through code line by line, and display ...
can help a programmer find faulty code by examining the inner workings of a program such as executing code line-by-line and viewing variable values. As an alternative to using a debugger, code may be instrumented with logic to output debug information to trace program execution and view values. Output is typically to
console Console may refer to: Computing and video games * System console, a physical device to operate a computer ** Virtual console, a user interface for multiple computer consoles on one device ** Command-line interface, a method of interacting with ...
,
window A window is an opening in a wall, door, roof, or vehicle that allows the exchange of light and may also allow the passage of sound and sometimes air. Modern windows are usually glazed or covered in some other transparent or translucent ma ...
,
log file In computing, logging is the act of keeping a log of events that occur in a computer system, such as problems, errors or broad information on current operations. These events may occur in the operating system or in other software. A message o ...
or a hardware output (i.e. LED). Some contend that locating a bug is something of an art. It is not uncommon for a bug in one section of a program to cause failures in a different section, thus making it difficult to track, in an apparently unrelated part of the system. For example, an error in a graphics rendering routine causing a file I/O routine to fail. Sometimes, the most difficult part of debugging is finding the cause of the bug. Once found, correcting the problem is sometimes easy if not trivial. Sometimes, a bug is not an isolated flaw, but represents an error of thinking or planning on the part of the programmers. Often, such a ''
logic error In computer programming, a logic error is a Software bug, bug in a program that causes it to operate incorrectly, but not to terminate abnormally (or crash (computing), crash). A logic error produces unintended or undesired output or other behav ...
'' requires a section of the program to be overhauled or rewritten. Some contend that as a part of
code review Code review (sometimes referred to as peer review) is a software quality assurance activity in which one or more people examine the source code of a computer program, either after implementation or during the development process. The persons perf ...
, stepping through the code and imagining or transcribing the execution process may often find errors without ever reproducing the bug as such. Typically, the first step in locating a bug is to reproduce it reliably. If unable to reproduce the issue, a programmer cannot find the cause of the bug and therefore cannot fix it. Some bugs are revealed by inputs that may be difficult for the programmer to re-create. One cause of the Therac-25 radiation machine deaths was a bug (specifically, a
race condition A race condition or race hazard is the condition of an electronics, software, or other system where the system's substantive behavior is dependent on the sequence or timing of other uncontrollable events, leading to unexpected or inconsistent ...
) 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 stop occurring whenever the setup is augmented to help find the bug, such as running the program with a debugger; these are called ''
heisenbug In computer programming jargon, a heisenbug is a software bug that seems to disappear or alter its behavior when one attempts to study it. The term is a pun on the name of Werner Heisenberg, the physicist who first asserted the observer effect ...
s'' (humorously named after the
Heisenberg uncertainty principle The uncertainty principle, also known as Heisenberg's indeterminacy principle, is a fundamental concept in quantum mechanics. It states that there is a limit to the precision with which certain pairs of physical properties, such as position a ...
). Since the 1990s, particularly following the Ariane 5 Flight 501 disaster, interest in automated aids to debugging rose, such as
static code analysis In computer science, static program analysis (also known as static analysis or static simulation) is the analysis of computer programs performed without executing them, in contrast with dynamic program analysis, which is performed on programs duri ...
by abstract interpretation. Often, bugs come about during coding, but faulty design documentation may cause a bug. In some cases, changes to the code may eliminate the problem even though the code then no longer matches the documentation. In an
embedded system An embedded system is a specialized computer system—a combination of a computer processor, computer memory, and input/output peripheral devices—that has a dedicated function within a larger mechanical or electronic system. It is e ...
, the software is often modified to work around a hardware bug since it's cheaper than modifying the hardware.


Management

Bugs are managed via activities like documenting, categorizing, assigning, reproducing, correcting and releasing the corrected code.
Tools A tool is an object that can extend an individual's ability to modify features of the surrounding environment or help them accomplish a particular task. Although many animals use simple tools, only human beings, whose use of stone tools dates ...
are often used to track bugs and other issues with software. Typically, different tools are used by the software development team to track their workload than by
customer service Customer service is the assistance and advice provided by a company to those who buy or use its products or services, either in person or remotely. Customer service is often practiced in a way that reflects the strategies and values of a firm, and ...
to track user feedback. A tracked item is often called ''bug'', ''defect'', ''ticket'', ''issue'', ''feature'', or for
agile software development Agile software development is an umbrella term for approaches to software development, developing software that reflect the values and principles agreed upon by ''The Agile Alliance'', a group of 17 software practitioners, in 2001. As documented ...
, ''story'' or ''epic''. Items are often categorized by aspects such as severity, priority and
version number Software versioning is the process of assigning either unique ''version names'' or unique ''version numbers'' to unique states of computer software. Within a given version number category (e.g., major or minor), these numbers are generally assig ...
. In a process sometimes called triage, choices are made for each bug about whether and when to fix it based on information such as the bug's severity and priority and external factors such as development schedules. Triage generally does not include investigation into cause. Triage may occur regularly. Triage generally consists of reviewing new bugs since the previous triage and maybe all open bugs. Attendees may include project manager, development manager, test manager, build manager, and technical experts.


Severity

''Severity'' is a measure of impact the bug has. This impact may be data loss, financial, loss of goodwill and wasted effort. Severity levels are not standardized, but differ by context such as industry and tracking tool. For example, a crash in a video game has a different impact than a crash in a bank server. Severity levels might be ''crash or hang'', ''no workaround'' (user cannot accomplish a task), ''has workaround'' (user can still accomplish the task), ''visual defect'' (a misspelling for example), or ''documentation error''. Another example set of severities: ''critical'', ''high'', ''low'', ''blocker'', ''trivial''. The severity of a bug may be a separate category to its priority for fixing, or the two may be quantified and managed separately. A bug severe enough to delay the release of the product is called a ''show stopper''.


Priority

''Priority'' describes the importance of resolving the bug in relation to other bugs. Priorities might be numerical, such as 1 through 5, or named, such as ''critical'', ''high'', ''low'', and ''deferred''. The values might be similar or identical to severity ratings, even though priority is a different aspect. Priority may be a combination of the bug's severity with the level of effort to fix. A bug with low severity but easy to fix may get a higher priority than a bug with moderate severity that requires significantly more effort to fix.


Patch

Bugs of sufficiently high priority may warrant a special release which is sometimes called a '' patch''.


Maintenance release

A software release that emphasizes bug fixes may be called a ''maintenance'' release to differentiate it from a release that emphasizes new features or other changes.


Known issue

It is common practice to release software with known, low-priority bugs or other issues. Possible reasons include but are not limited to: * A deadline must be met and resources are insufficient to fix all bugs by the deadline * The bug is already fixed in an upcoming release, and it is not of high priority * The changes required to fix the bug are too costly or affect too many other components, requiring a major testing activity * It may be suspected, or known, that some users are relying on the existing buggy behavior; a proposed fix may introduce a
breaking change In telecommunications and computing, backward compatibility (or backwards compatibility) is a property of an operating system, software, real-world product, or technology that allows for interoperability with an older legacy system, or with Input ...
* The problem is in an area that will be obsolete with an upcoming release; fixing it is unnecessary * "It's not a bug, it's a feature" A misunderstanding exists between expected and actual behavior or undocumented feature


Implications

The amount and type of damage a software bug may cause affects decision-making, processes and policy regarding software quality. In applications such as
human spaceflight Human spaceflight (also referred to as manned spaceflight or crewed spaceflight) is spaceflight with a crew or passengers aboard a spacecraft, often with the spacecraft being operated directly by the onboard human crew. Spacecraft can also be ...
,
aviation Aviation includes the activities surrounding mechanical flight and the aircraft industry. ''Aircraft'' include fixed-wing and rotary-wing types, morphable wings, wing-less lifting bodies, as well as lighter-than-air aircraft such as h ...
,
nuclear power Nuclear power is the use of nuclear reactions to produce electricity. Nuclear power can be obtained from nuclear fission, nuclear decay and nuclear fusion reactions. Presently, the vast majority of electricity from nuclear power is produced by ...
,
health care Health care, or healthcare, is the improvement or maintenance of health via the preventive healthcare, prevention, diagnosis, therapy, treatment, wikt:amelioration, amelioration or cure of disease, illness, injury, and other disability, physic ...
,
public transport Public transport (also known as public transit, mass transit, or simply transit) are forms of transport available to the general public. It typically uses a fixed schedule, route and charges a fixed fare. There is no rigid definition of whic ...
or
automotive safety Automotive safety is the study and practice of automotive design, construction, equipment and regulation to minimize the occurrence and consequences of traffic collisions involving motor vehicles. Road traffic safety more broadly includes roadw ...
, since software flaws have the potential to cause human injury or even death, such software will have far more scrutiny and quality control than, for example, an online shopping website. In applications such as banking, where software flaws have the potential to cause serious financial damage to a bank or its customers, quality control is also more important than, say, a photo editing application. Other than the damage caused by bugs, some of their cost is due to the effort invested in fixing them. In 1978, Lientz et al. showed that the median of projects invest 17 percent of the development effort in bug fixing. In 2020, research on
GitHub GitHub () is a Proprietary software, proprietary developer platform that allows developers to create, store, manage, and share their code. It uses Git to provide distributed version control and GitHub itself provides access control, bug trackin ...
repositories showed the median is 20%.


Cost

In 1994, NASA's Goddard Space Flight Center managed to reduce their average number of errors from 4.5 per 1,000 lines of code ( SLOC) down to 1 per 1000 SLOC. Another study in 1990 reported that exceptionally good software development processes can achieve deployment failure rates as low as 0.1 per 1000 SLOC. This figure is iterated in literature such as '' Code Complete'' by
Steve McConnell Steven C. McConnell is an author of software engineering textbooks such as '' Code Complete'', ''Rapid Development'', and ''Software Estimation''. He is cited as an expert in software engineering and project management. Career McConnell gradua ...
, and the ''NASA study on Flight Software Complexity''. Some projects even attained zero defects: the
firmware In computing Computing is any goal-oriented activity requiring, benefiting from, or creating computer, computing machinery. It includes the study and experimentation of algorithmic processes, and the development of both computer hardware, h ...
in the IBM Wheelwriter typewriter which consists of 63,000 SLOC, and the
Space Shuttle The Space Shuttle is a retired, partially reusable launch system, reusable low Earth orbital spacecraft system operated from 1981 to 2011 by the U.S. National Aeronautics and Space Administration (NASA) as part of the Space Shuttle program. ...
software with 500,000 SLOC.


Benchmark

To facilitate reproducible research on testing and debugging, researchers use curated benchmarks of bugs: * the Siemens benchmark * ManyBugs is a benchmark of 185 C bugs in nine open-source programs. * Defects4J is a benchmark of 341 Java bugs from 5 open-source projects. It contains the corresponding patches, which cover a variety of patch type.


Types

Some notable types of bugs:


Design error

A bug can be caused by insufficient or incorrect design based on the specification. For example, given that the specification is to alphabetize a list of words, a design bug might occur if the design does not account for symbols; resulting in incorrect alphabetization of words with symbols.


Arithmetic

Numerical operations can result in unexpected output, slow processing, or crashing. Such a bug can be from a lack of awareness of the qualities of the data storage such as a loss of precision due to
rounding Rounding or rounding off is the process of adjusting a number to an approximate, more convenient value, often with a shorter or simpler representation. For example, replacing $ with $, the fraction 312/937 with 1/3, or the expression √2 with ...
, numerically unstable algorithms, arithmetic overflow and underflow, or from lack of awareness of how calculations are handled by different software coding languages such as
division by zero In mathematics, division by zero, division (mathematics), division where the divisor (denominator) is 0, zero, is a unique and problematic special case. Using fraction notation, the general example can be written as \tfrac a0, where a is the di ...
which in some languages may throw an exception, and in others may return a special value such as NaN or
infinity Infinity is something which is boundless, endless, or larger than any natural number. It is denoted by \infty, called the infinity symbol. From the time of the Ancient Greek mathematics, ancient Greeks, the Infinity (philosophy), philosophic ...
.


Control flow

A
control flow In computer science, control flow (or flow of control) is the order in which individual statements, instructions or function calls of an imperative program are executed or evaluated. The emphasis on explicit control flow distinguishes an '' ...
bug, a.k.a. logic error, is characterized by code that does not fail with an error, but does not have the expected behavior, such as
infinite loop In computer programming, an infinite loop (or endless loop) is a sequence of instructions that, as written, will continue endlessly, unless an external intervention occurs, such as turning off power via a switch or pulling a plug. It may be inte ...
ing, infinite
recursion Recursion occurs when the definition of a concept or process depends on a simpler or previous version of itself. Recursion is used in a variety of disciplines ranging from linguistics to logic. The most common application of recursion is in m ...
, incorrect comparison in a conditional such as using the wrong comparison operator, and the
off-by-one error An off-by-one error or off-by-one bug (known by acronyms OBOE, OBOB, OBO and OB1) is a logic error that involves a number that differs from its intended value by 1. An off-by-one error can sometimes appear in a mathematics, mathematical context. ...
.


Interfacing

* Incorrect API usage. * Incorrect protocol implementation. * Incorrect hardware handling. * Incorrect assumptions of a particular platform. * Incompatible systems. A new
API An application programming interface (API) is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build ...
or
communications protocol A communication protocol is a system of rules that allows two or more entities of a communications system to transmit information via any variation of a physical quantity. The protocol defines the rules, syntax, semantics (computer science), sem ...
may seem to work when two systems use different versions, but errors may occur when a function or feature implemented in one version is changed or missing in another. In production systems which must run continually, shutting down the entire system for a major update may not be possible, such as in the telecommunication industry or the internet. In this case, smaller segments of a large system are upgraded individually, to minimize disruption to a large network. However, some sections could be overlooked and not upgraded, and cause compatibility errors which may be difficult to find and repair. * Incorrect code annotations.


Concurrency

* Deadlock a task cannot continue until a second finishes, but at the same time, the second cannot continue until the first finishes. *
Race condition A race condition or race hazard is the condition of an electronics, software, or other system where the system's substantive behavior is dependent on the sequence or timing of other uncontrollable events, leading to unexpected or inconsistent ...
multiple simultaneous tasks compete for resources. * Errors in critical sections,
mutual exclusion In computer science, mutual exclusion is a property of concurrency control, which is instituted for the purpose of preventing race conditions. It is the requirement that one thread of execution never enters a critical section while a concurr ...
s and other features of concurrent processing. Time-of-check-to-time-of-use (TOCTOU) is a form of unprotected critical section.


Resourcing

*
Null pointer In computing, a null pointer (sometimes shortened to nullptr or null) or null reference is a value saved for indicating that the Pointer (computer programming), pointer or reference (computer science), reference does not refer to a valid Object (c ...
dereference. * Using an
uninitialized variable In computing, an uninitialized variable is a variable (programming), variable that is declared but is not set to a definite known value before it is used. It will have ''some'' value, but not a predictable one. As such, it is a programming error an ...
. * Using an otherwise valid instruction on the wrong
data type In computer science and computer programming, a data type (or simply type) is a collection or grouping of data values, usually specified by a set of possible values, a set of allowed operations on these values, and/or a representation of these ...
(see packed decimal/ binary-coded decimal). * Access violations. * Resource leaks, where a finite system resource (such as
memory Memory is the faculty of the mind by which data or information is encoded, stored, and retrieved when needed. It is the retention of information over time for the purpose of influencing future action. If past events could not be remembe ...
or file handles) become exhausted by repeated allocation without release. * Buffer overflow, in which a program tries to store data past the end of allocated storage. This may or may not lead to an access violation or storage violation. These are frequently security bugs. * Excessive recursion which—though logically valid—causes
stack overflow In software, a stack overflow occurs if the call stack pointer exceeds the stack bound. The call stack may consist of a limited amount of address space, often determined at the start of the program. The size of the call stack depends on many fa ...
. * Use-after-free error, where a pointer is used after the system has freed the memory it references. * Double free error.


Syntax

* Use of the wrong token, such as performing assignment instead of equality test. For example, in some languages x=5 will set the value of x to 5 while x

5
will check whether x is currently 5 or some other number. Interpreted languages allow such code to fail. Compiled languages can catch such errors before testing begins.


Teamwork

* Unpropagated updates; e.g. programmer changes "myAdd" but forgets to change "mySubtract", which uses the same algorithm. These errors are mitigated by the
Don't Repeat Yourself "Don't repeat yourself" (DRY) is a principle of software development aimed at reducing repetition of information which is likely to change, replacing it with abstractions that are less likely to change, or using data normalization which avoids r ...
philosophy. * Comments out of date or incorrect: many programmers assume the comments accurately describe the code. * Differences between documentation and product.


In politics


"Bugs in the System" report

The Open Technology Institute, run by the group, New America, released a report "Bugs in the System" in August 2016 stating that U.S. policymakers should make reforms to help researchers identify and address software bugs. The report "highlights the need for reform in the field of software vulnerability discovery and disclosure." One of the report's authors said that
Congress A congress is a formal meeting of the representatives of different countries, constituent states, organizations, trade unions, political parties, or other groups. The term originated in Late Middle English to denote an encounter (meeting of ...
has not done enough to address cyber software vulnerability, even though Congress has passed a number of bills to combat the larger issue of cyber security. Government researchers, companies, and cyber security experts are the people who typically discover software flaws. The report calls for reforming computer crime and copyright laws.


In popular culture

* In video gaming, the term " glitch" is sometimes used to refer to a software bug. An example is the glitch and unofficial Pokémon species MissingNo. * In both the 1968 novel '' 2001: A Space Odyssey'' and the corresponding film of the same name, the spaceship's onboard computer, HAL 9000, attempts to kill all its crew members. In the follow-up 1982 novel, '' 2010: Odyssey Two'', and the accompanying 1984 film, '' 2010: The Year We Make Contact'', it is revealed that this action was caused by the computer having been 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 caused HAL to become paranoid and eventually homicidal. * In the English version of the Nena 1983 song '' 99 Luftballons'' (99 Red Balloons) as a result of "bugs in the software", a release of a group of 99 red balloons are mistaken for an enemy nuclear missile launch, requiring an equivalent launch response and resulting in catastrophe. * In the 1999 American comedy '' Office Space'', three employees attempt (unsuccessfully) to exploit their company's preoccupation with the Y2K computer bug using a computer virus that sends rounded-off fractions of a penny to their bank account—a long-known technique described as salami slicing. * The 2004 novel ''The Bug'', by Ellen Ullman, is about a programmer's attempt to find an elusive bug in a database application. * The 2008 Canadian film '' Control Alt Delete'' is about a computer programmer at the end of 1999 struggling to fix bugs at his company related to the year 2000 problem.


See also

*
Anti-pattern An anti-pattern in software engineering, project management, and business processes is a common response to a recurring problem that is usually ineffective and risks being highly counterproductive. The term, coined in 1995 by computer programmer An ...
* Automatic bug fixing * Bug bounty program *
Glitch removal Glitch removal is the elimination of Glitch#Electronics glitch, glitchesunnecessary signal transitions without functionalityfrom electronic circuits. Power dissipation of a gate occurs in two ways: static power dissipation and dynamic power dissip ...
* Hardware bug *
ISO/IEC 9126 ISO/IEC 9126 ''Software engineering — Product quality'' was an international standard for the evaluation of software quality. It has been replaced by ISO/IEC 25010:2011. The fundamental objective of the ISO/IEC 9126 standard is to address som ...
, which classifies a bug as either a ''defect'' or a ''nonconformity'' * List of software bugs * Orthogonal Defect Classification * Racetrack problem * RISKS Digest * Single-event upset * Software defect indicator * Software regression * Software rot * VUCA


References


External links

*
Common Weakness Enumeration
– an expert webpage focus on bugs, at NIST.gov
BUG type of Jim Gray
– another Bug type * *

– an email from 1981 about Adm. Hopper's bug *
Toward Understanding Compiler Bugs in GCC and LLVM
. A 2016 study of bugs in compilers {{Authority control