debugging debug redirects here for other uses see debug disambiguation 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 debugging is the process of finding and resolving defects or problems within a computer program that prevent correct operation of computer software or a system debugging tactics can involve interactive debugging control flow analysis unit testing integration testing log file analysis monitoring at the application or system level memory dumps and profiling origin of the term a computer log entry from the markii with a moth taped to the page the terms bug and debugging are popularly attributed to admiral grace hopper in the 1940s regarding the recruitment of additional technical staff the oxford english dictionary entry for debug quotes the term debugging used in reference to airplane engine testing in a 1945 article in the journal of the royal aeronautical society an article in airforce june 1945 p50 also refers to debugging this time of aircraft cameras hoppers bug was found on september 9 1947 the term was not adopted by computer programmers until the early 1950s the seminal article by gill in 1951 is the earliest indepth discussion of programming errors but it does not use the term bug or debugging in the acms digital library the term debugging is first used in three papers from 1952 acm national meetings two of the three use the term in quotation marks by 1963 debugging was a common enough term to be mentioned in passing without explanation on page 1 of the ctss manual kidwells article stalking the elusive computer bug discusses the etymology of bug and debug in greater detail scope as software and electronic systems have become generally more complex the various common debugging techniques have expanded with more methods to detect anomalies assess impact and schedule software patches or full updates to a system the words anomaly and discrepancy can be used as being more neutral terms to avoid the words error and defect or bug where there might be an implication that all socalled errors defects or bugs must be fixed at all costs instead an impact assessment can be made to determine if changes to remove an anomaly or discrepancy would be costeffective for the system or perhaps a scheduled new release might render the changes unnecessary not all issues are lifecritical or missioncritical in a system also it is important to avoid the situation where a change might be more upsetting to users longterm than living with the known problems where the cure would be worse than the disease basing decisions of the acceptability of some anomalies can avoid a culture of a zerodefects mandate where people might be tempted to deny the existence of problems so that the result would appear as zero defects considering the collateral issues such as the costversusbenefit impact assessment then broader debugging techniques will expand to determine the frequency of anomalies how often the same bugs occur to help assess their impact to the overall system tools see also debugger debugging on video game consoles is usually done with special hardware such as this xbox debug unit intended for developers debugging ranges in complexity from fixing simple errors to performing lengthy and tiresome tasks of data collection analysis and scheduling updates the debugging skill of the programmer can be a major factor in the ability to debug a problem but the difficulty of software debugging varies greatly with the complexity of the system and also depends to some extent on the programming languages used and the available tools such as debuggers debuggers are software tools which enable the programmer to monitor the execution of a program stop it restart it set breakpoints and change values in memory the term debugger can also refer to the person who is doing the debugging generally highlevel programming languages such as java make debugging easier because they have features such as exception handling and type checking that make real sources of erratic behaviour easier to spot in programming languages such as c or assembly bugs may cause silent problems such as memory corruption and it is often difficult to see where the initial problem happened in those cases memory debugger tools may be needed in certain situations general purpose software tools that are language specific in nature can be very useful these take the form of static code analysis tools these tools look for a very specific set of known problems some common and some rare within the source code all such issues detected by these tools would rarely be picked up by a compiler or interpreter thus they are not syntax checkers but more semantic checkers some tools claim to be able to detect 300 unique problems both commercial and free tools exist in various languages these tools can be extremely useful when checking very large source trees where it is impractical to do code walkthroughs a typical example of a problem detected would be a variable dereference that occurs before the variable is assigned a value as another example some such tools perform strong type checking when the language does not require it thus they are better at locating likely errors versus actual errors as a result these tools have a reputation of false positives the old unix lint program is an early example for debugging electronic hardware eg computer hardware as well as lowlevel software eg bioses device drivers and firmware instruments such as oscilloscopes logic analyzers or incircuit emulators ices are often used alone or in combination an ice may perform many of the typical software debuggers tasks on lowlevel software and firmware debugging process normally the first step in debugging is to attempt to reproduce the problem this can be a nontrivial task for example as with parallel processes or some unusual software bugs also specific user environment and usage history can make it difficult to reproduce the problem after the bug is reproduced the input of the program may need to be simplified to make it easier to debug for example a bug in a compiler can make it crash when parsing some large source file however after simplification of the test case only few lines from the original source file can be sufficient to reproduce the same crash such simplification can be made manually using a divideandconquer approach the programmer will try to remove some parts of original test case and check if the problem still exists when debugging the problem in a gui the programmer can try to skip some user interaction from the original problem description and check if remaining actions are sufficient for bugs to appear after the test case is sufficiently simplified a programmer can use a debugger tool to examine program states values of variables plus the call stack and track down the origin of the problems alternatively tracing can be used in simple cases tracing is just a few print statements which output the values of variables at certain points of program execution techniques interactive debugging print debugging or tracing is the act of watching live or recorded trace statements or print statements that indicate the flow of execution of a process this is sometimes called printf debugging due to the use of the printf function in c this kind of debugging was turned on by the command tron in the original versions of the noviceoriented basic programming language tron stood for trace on tron caused the line numbers of each basic command line to print as the program ran remote debugging is the process of debugging a program running on a system different from the debugger to start remote debugging a debugger connects to a remote system over a network the debugger can then control the execution of the program on the remote system and retrieve information about its state postmortem debugging is debugging of the program after it has already crashed related techniques often include various tracing techniques for example andor analysis of memory dump or core dump of the crashed process the dump of the process could be obtained automatically by the system for example when process has terminated due to an unhandled exception or by a programmerinserted instruction or manually by the interactive user wolf fence algorithm edward gauss described this simple but very useful and now famous algorithm in a 1982 article for communications of the acm as follows theres one wolf in alaska how do you find it first build a fence down the middle of the state wait for the wolf to howl determine which side of the fence it is on repeat process on that side only until you get to the point where you can see the wolf this is implemented eg in the git version control system as the command git bisect which uses the above algorithm to determine which commit introduced a particular bug delta debugging a technique of automating test case simplificationp123 saff squeeze a technique of isolating failure within the test using progressive inlining of parts of the failing test debugging for embedded systems in contrast to the general purpose computer software design environment a primary characteristic of embedded environments is the sheer number of different platforms available to the developers cpu architectures vendors operating systems and their variants embedded systems are by definition not generalpurpose designs they are typically developed for a single task or small range of tasks and the platform is chosen specifically to optimize that application not only does this fact make life tough for embedded system developers it also makes debugging and testing of these systems harder as well since different debugging tools are needed for different platforms despite the challenge of heterogeneity mentioned above some debuggers have been developed commercially as well as research prototypes examples of commercial solutions come from green hills software they all leverage a functionality available on lowcost embedded processors an onchip debug module ocdm whose signals are exposed through a standard jtag interface they are benchmarked based on how much change to the application is needed and the rate of events that they can keep up with in addition to the typical task of identifying bugs in the system embedded system debugging also seeks to collect information about the operating states of the system that may then be used to analyze the system to find ways to boost its performance or to optimize other important characteristics eg energy consumption reliability realtime response etc antidebugging antidebugging is the implementation of one or more techniques within computer code that hinders attempts at reverse engineering or debugging a target process techniques used in antidebugging include apibased check for the existence of a debugger using system information exceptionbased check to see if exceptions are interfered with process and thread blocks check whether process and thread blocks have been manipulated modified code check for code modifications made by a debugger handling software breakpoints hardware and registerbased check for hardware breakpoints and cpu registers timing and latency check the time taken for the execution of instructions detecting and penalizing debugger an early example of antidebugging existed in early versions of microsoft word which if a debugger was detected produced a message that said the tree of evil bears bitter fruit now trashing program disk after which it caused the floppy disk drive to emit alarming noises with the intent of scaring the user away from attempting it again software testing portal assertion computing automatic bug fixing debugging patterns magic debug values software bug software testing shotgun debugging troubleshooting david j agans debugging the nine indispensable rules for finding even the most elusive software and hardware problems amacom 2002 isbn0814471684 bill blunden software exorcism a handbook for debugging and optimizing legacy code apress 2003 isbn1590592344 ann r ford toby j teorey practical debugging in c prentice hall 2002 isbn0130653942 thorsten grtker ulrich holtmann holger keding markus wloka the developers guide to debugging second edition createspace 2012 isbn1470185520 robert c metzger debugging by thinking a multidisciplinary approach digital press 2003 isbn1555583075 glenford j myers the art of software testing john wiley sons inc 2004 isbn0471043281 john robbins debugging applications microsoft press 2000 isbn0735608865 matthew a telles yuan hsieh the science of debugging the coriolis group 2001 isbn1576109178 dmitry vostokov memory dump analysis anthology volume 1 opentask 2008 isbn9780955832802 andreas zeller why programs fail second edition a guide to systematic debugging morgan kaufmann 2009 isbn0123745152 wikiquote has quotations related to debugging the wikibook computer programming principles has a page on the topic of debugging crash dump analysis patterns indepth articles on analyzing and finding bugs in crash dumps learn the essentials of debugging how to improve your debugging skills a good article at ibm developerworks archived from the original on february 18 2007 plugin based debugging for embedded systems embedded systems test and debug about digital input generation results of a survey about embedded system test and debug byte paradigm archived from the original on january 12 2012 