software bug to report a mediawiki error on wikipedia see wikipediabug reports software development core activities processes requirements design engineering construction testing debugging deployment maintenance paradigms and models agile cleanroom incremental prototyping spiral v model waterfall methodologies and frameworks asd devops dad dsdm fdd iid kanban lean sd less mdd msf psp rad rup safe scrum semat tsp up xp supporting disciplines configuration management documentation software quality assurance sqa project management user experience practices atdd bdd cco ci cd ddd pp standup tdd tools compiler debugger profiler gui designer modeling ide build automation release automation infrastructure as code testing standards and bodies of knowledge babok cmmi ieee standards iso 9001 isoiec standards pmbok swebok itil glossaries artificial intelligence computer science electrical and electronics engineering vte a software bug is an error flaw failure or fault in a computer program or system that causes it to produce an incorrect or unexpected result or to behave in unintended ways the process of fixing bugs is termed debugging and often uses formal techniques or tools to pinpoint bugs and since the 1950s some computer systems have been designed to also deter detect or autocorrect various computer bugs during operations most bugs arise from mistakes and errors made in either a programs source code or its design or in components and operating systems used by such programs a few are caused by compilers producing incorrect code a program that contains a large number of bugs andor bugs that seriously interfere with its functionality is said to be buggy defective bugs can trigger errors that may have ripple effects bugs may have subtle effects or cause the program to crash or freeze the computer other bugs qualify as security bugs and might for example enable a malicious user to bypass access controls in order to obtain unauthorized privileges some software bugs have been linked to disasters bugs in code that controlled the therac25 radiation therapy machine were directly responsible for patient deaths in the 1980s in 1996 the european space agencys us1billion prototype ariane 5 rocket had to be destroyed less than a minute after launch due to a bug in the onboard guidance computer program in june 1994 a royal air force chinook helicopter crashed into the mull of kintyre killing 29 this was initially dismissed as pilot error but an investigation by computer weekly convinced a house of lords inquiry that it may have been caused by a software bug in the aircrafts enginecontrol computer in 2002 a study commissioned by the us department of commerces national institute of standards and technology concluded that software bugs or errors are so prevalent and so detrimental that they cost the us economy an estimated 59billion annually or about 06 percent of the gross domestic product etymology the term bug to describe defects has been a part of engineering jargon since the 1870s and predates electronic computers and computer software it may have originally been used in hardware engineering to describe mechanical malfunctions for instance thomas edison wrote the following words in a letter to an associate in 1878 mwparseroutput templatequoteoverflowhiddenmargin1em 0padding0 40pxmwparseroutput templatequote templatequotecitelineheight15emtextalignleftpaddingleft16emmargintop0it has been just so in all of my inventions the first step is an intuition and comes with a burst then difficulties arisethis thing gives out and the middle english word bugge is the basis for the terms bugbear and bugaboo as terms used for a monster isaac asimov used the term bug to relate to issues with a robot in his short story catch that rabbit published in 1944 a page from the harvard mark ii electromechanical computers log featuring a dead moth that was removed from the device the term bug was used in an account by computer pioneer grace hopper who publicized the cause of a malfunction in an early electromechanical computer a typical version of the story is in 1946 when hopper was released from active duty she joined the harvard faculty at the computation laboratory where she continued her work on the mark ii and mark iii operators traced an error in the mark ii to a moth trapped in a relay coining the term bug this bug was carefully removed and taped to the log book stemming from the first bug today we call errors or glitches in a program a bug hopper did not find the bug as she readily acknowledged the date in the log book was september 9 1947 the related term debug also appears to predate its usage in computing the oxford english dictionarys etymology of the word contains an attestation from 1945 in the context of aircraft engines history t a edison was the first to use the term bug for a technical malfunction in the year 1878 when he was working on light bulbs he mentioned the term in a private letter which was sold at an auction in 2018 the concept that software might contain errors dates back to ada lovelaces 1843 notes on the analytical engine in which she speaks of the possibility of program cards for charles babbages analytical engine being erroneous an analysing process must equally have been performed in order to furnish the analytical engine with the necessary operative data and that herein may also lie a possible source of error granted that the actual mechanism is unerring in its processes the cards may give it wrong orders bugs in the system report the open technology institute run by the group new america 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 the computer fraud and abuse act the digital millennium copyright act and the electronic communications privacy act criminalize and create civil penalties for actions that security researchers routinely engage in while conducting legitimate security research the report said terminology while the use of the term bug to describe software errors is common many have suggested that it should be abandoned one argument is that the word bug is divorced from a sense that a human being caused the problem and instead implies that the defect arose on its own leading to a push to abandon the term bug in favor of terms such as defect with limited success in software engineering 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 entire cycle may be described as mistakes anomalies faults failures errors exceptions crashes bugs defects incidents or side effects prevention the software industry has put much effort into reducing bug counts these include typographical errors bugs usually appear when the programmer makes a logic error various innovations in programming style and defensive programming are designed to make these bugs less likely or easier to spot some typos especially of symbols or logicalmathematical operators allow the program to operate incorrectly while others such as a missing symbol or misspelled name may prevent the program from operating compiled languages can reveal some typos when the source code is compiled development methodologies several schemes assist managing programmer activity so that fewer bugs are produced software engineering which addresses software design issues as well applies many techniques to prevent defects for example formal program specifications state the exact behavior of programs so that design bugs may be eliminated unfortunately formal specifications are impractical for anything but the shortest programs because of problems of combinatorial explosion and indeterminacy unit testing involves writing a test for every function unit that a program is to perform in testdriven development unit tests are written before the code and the code is not considered complete until all tests complete successfully agile software development involves frequent software releases with relatively small changes defects are revealed by user feedback open source development allows anyone to examine source code a school of thought popularized by eric s raymond as linuss law says that popular opensource software has more chance of having few or no bugs than other software because given enough eyeballs all bugs are shallow an example of this actually happening accidentally was the 2008 openssl vulnerability in debian programming language support programming languages include features to help prevent bugs such as static type systems restricted namespaces and modular programming for example when a programmer writes pseudocode let realvalue pi three and a bit although this may be syntactically correct the code fails a type check compiled languages catch this without having to run the program interpreted languages catch such errors at runtime some languages deliberate exclude features that easily lead to bugs at the expense of slower performance the general principle being that it is almost always better to write simpler slower code than inscrutable code that runs slightly faster especially considering that maintenance cost is substantial for example the java programming language does not support pointer arithmetic implementations of some languages such as pascal and scripting languages often have runtime bounds checking of arrays at least in a debugging build code analysis tools for code analysis help developers by inspecting the program text beyond the compilers capabilities to spot potential problems although in general the problem of finding all programming errors given a specification is not solvable see halting problem these tools exploit the fact that human programmers tend to make certain kinds of simple mistakes often 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 testing software testers are people whose primary task is to find bugs or write code to support testing on some projects more resources may be spent on testing than in developing the program 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 debugging the typical bug history gnu classpath project data a new bug submitted by the user is unconfirmed once it has been reproduced by a developer it is a confirmed bug the confirmed bugs are later fixed bugs belonging to other categories unreproducible will not be fixed etc are usually in the minority debugging finding and fixing bugs or debugging is 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 usually the most difficult part of debugging is finding the bug once it is found correcting it is usually relatively easy programs known as debuggers help programmers locate bugs by executing code line by line watching variable values and other features to observe program behavior without a debugger code may be added so that messages or values may be written to a console or to a window or log file to trace program execution or show values 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 graphics rendering routine causing a file io routine to fail in an apparently unrelated part of the system sometimes a bug is not an isolated flaw 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 as a part of code review stepping through the code and imagining or transcribing the execution process may often find errors without ever reproducing the bug as such more typically the first step in locating a bug is to reproduce it reliably once the bug is reproducible the programmer may use a debugger or other tool while reproducing the error to find the point at which the program went astray some bugs are revealed by inputs that may be difficult for the programmer to recreate one cause of the therac25 radiation machine deaths was a bug specifically a race condition 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 called heisenbugs humorously named after the heisenberg uncertainty principle since the 1990s particularly following the ariane 5 flight 501 disaster interest in automated aids to debugging rose such as static code analysis by abstract interpretation some classes of bugs have nothing to do with the code faulty documentation or hardware may lead to problems in system use even though the code matches the documentation in some cases changes to the code eliminate the problem even though the code then no longer matches the documentation embedded systems frequently work around hardware bugs since to make a new version of a rom is much cheaper than remanufacturing the hardware especially if they are commodity items benchmark of bugs 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 opensource programs defects4j bug management bug management includes the process of documenting categorizing assigning reproducing correcting and releasing the corrected code proposed changes to software bugs as well as enhancement requests and even entire releases are commonly tracked and managed using bug tracking systems or issue tracking systems the items added may be called defects tickets issues or following the agile development paradigm stories and epics categories may be objective subjective or a combination such as version number area of the software severity and priority as well as what type of issue it is such as a feature request or a bug severity severity is the impact the bug has on system operation this impact may be data loss financial loss of goodwill and wasted effort severity levels are not standardized impacts differ across industry a crash in a video game has a totally different impact than a crash in a web browser or real time monitoring system for example bug severity levels might be crash or hang no workaround meaning there is no way the customer can accomplish a given task has workaround meaning the user can still accomplish the task visual defect for example a missing image or displaced button or form element or documentation error some software publishers use more qualified severities such as critical high low blocker or trivial the severity of a bug may be a separate category to its priority for fixing and the two may be quantified and managed separately priority priority controls where a bug falls on the list of planned changes the priority is decided by each software producer priorities are sometimes numerical and sometimes named such as critical high low or deferred note that these may be similar or even identical to severity ratings when looking at different software producers for example priority 1 bugs may always be fixed for the next release while 5 bugs may never be fixed industry practice employs an inverted scale so that highest priority are low numbers 0 and 1 while larger numbers indicate lower priority software releases it is common practice to release software with known lowpriority bugs most big software projects maintain two lists of known bugs those known to the software team and those to be told to users the second list informs users about bugs that are not fixed in a specific release and workarounds may be offered releases are of different kinds bugs of sufficiently high priority may warrant a special release of part of the code containing only modules with those fixes these are known as patches most releases include a mixture of behavior changes and multiple bug fixes releases that emphasize bug fixes are known as maintenance releases releases that emphasize feature additionschanges are known as major releases and often have names to distinguish the new features from the old reasons that a software publisher opts not to patch or even fix a particular bug include 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 the problem is in an area that will be obsolete with an upcoming release fixing it is unnecessary its not a bug a misunderstanding has arisen between expected and perceived behavior when such misunderstanding is not due to confusion arising from design flaws or faulty documentation types this section contains embedded lists that may be poorly defined unverified or indiscriminate please help to clean it up to meet wikipedias quality standards where appropriate incorporate items into the main body of the article august 2015 this section is in a list format that may be better presented using prose you can help by converting this section to prose if appropriate editing help is available august 2015 in software development projects a mistake or fault may be introduced at any stage bugs arise from oversights or misunderstandings made by a software team during specification design coding data entry or documentation for example a relatively simple program to alphabetize a list of words the design might fail to consider what should happen when a word contains a hyphen or when converting an abstract design into code the coder might inadvertently create an offbyone error and fail to sort the last word in a list errors may be as simple as a typing error a where a was intended another category of bug is called a race condition that may occur when programs have multiple components executing at the same time if the components interact in a different order than the developer intended they could interfere with each other and stop the program from completing its tasks these bugs may be difficult to detect or anticipate since they may not occur during every execution of a program conceptual errors are a developers misunderstanding of what the software must do the resulting software may perform according to the developers understanding but not what is really needed other types arithmetic division by zero arithmetic overflow or underflow loss of arithmetic precision due to rounding or numerically unstable algorithms logic infinite loops and infinite recursion offbyone error counting one too many or too few when looping syntax use of the wrong operator such as performing assignment instead of equality test for example in some languages x5 will set the value of x to 5 while x5 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 resource null pointer dereference using an uninitialized variable using an otherwise valid instruction on the wrong data type see packed decimalbinary coded decimal access violations resource leaks where a finite system resource such as memory 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 known as security bugs excessive recursion whichthough logically validcauses stack overflow useafterfree error where a pointer is used after the system has freed the memory it references double free error multithreading deadlock where task a cant continue until task b finishes but at the same time task b cant continue until task a finishes race condition where the computer does not perform tasks in the order the programmer intended concurrency errors in critical sections mutual exclusions and other features of concurrent processing timeofchecktotimeofuse toctou is a form of unprotected critical section interfacing incorrect api usage incorrect protocol implementation incorrect hardware handling incorrect assumptions of a particular platform incompatible systems a new api or communications protocol 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 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 teamworking unpropagated updates eg programmer changes myadd but forgets to change mysubtract which uses the same algorithm these errors are mitigated by the dont repeat yourself philosophy comments out of date or incorrect many programmers assume the comments accurately describe the code differences between documentation and product implications the amount and type of damage a software bug may cause naturally affects decisionmaking processes and policy regarding software quality in applications such as manned space travel or automotive safety 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 nasas software assurance technology center managed to reduce the number of errors to fewer than 01 per 1000 lines of code sloc but this was not felt to be feasible for projects in the business world wellknown bugs list of software bugs a number of software bugs have become wellknown usually due to their severity examples include various space and military aircraft crashes possibly the most famous bug is the year 2000 problem also known as the y2k bug in which it was feared that worldwide economic collapse would happen at the start of the year 2000 as a result of computers thinking it was 1900 in the end no major problems occurred the 2012 stock trading disruption involved one such incompatibility between the old api and a new api in popular culture in the 1968 novel 2001 a space odyssey and its corresponding 1968 film adaptation a spaceships onboard computer hal 9000 attempts to kill all its crew members in the followup 1982 novel 2010 odyssey two and the accompanying 1984 film 2010 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 1999 american comedy office space three employees attempt to exploit their companys preoccupation with fixing the y2k computer bug by infecting the companys computer system with a virus that sends rounded off pennies to a separate bank account the plan backfires as the virus itself has its own bug which sends large amounts of money to the account prematurely the 2004 novel the bug by ellen ullman is about a programmers 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 software testing portal antipattern bug bounty program glitch removal isoiec 9126 which classifies a bug as either a defect or a nonconformity orthogonal defect classification racetrack problem risks digest software defect indicator software regression software rot mediawiki has documentation related to bug management common weakness enumeration an expert webpage focus on bugs at nistgov bug type of jim gray another bug type picture of the first computer bug at the wayback machine archived january 12 2015 the first computer bug an email from 1981 about adm hoppers bug toward understanding compiler bugs in gcc and llvm a 2016 study of bugs in compilers 