Dictionary Definition
debug v : locate and correct errors in a computer
program code; "debug this program" [also: debugging, debugged]
User Contributed Dictionary
English
Verb
- To remove a hidden electronic surveillance device from somewhere
- To search for, and eliminate malfunctioning elements or errors in something, especially a computer program or machinery during start-up.
- To remove insects from somewhere
Synonyms
Translations
To remove a hidden electronic surveillance
device from somewhere
- Finnish: poistaa salakuuntelulaitteet
To search for, and eliminate malfunctioning
elements or errors in something
To remove insects from somewhere
Extensive Definition
Debugging is a methodical process of finding and
reducing the number of bugs, or
defects, in a computer
program or a piece of electronic
hardware thus making it behave as expected. Debugging tends to
be harder when various subsystems are
tightly coupled, as changes in one may cause bugs to emerge in
another.
Origin
There is some controversy over the origin of the term "debugging." The terms "bug" and "debugging" are both popularly attributed to Admiral Grace Hopper in the 1940s, but the term "bug" dates back at least to 1878 and Thomas Edison (see the Software bug article for a full discussion), and "debugging" seems to have been used as a term in aeronautics before entering the world of computers.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, but
Hopper's bug was not
found until 1947 and the term was not adopted by computer
programmers until the early 1950s. The seminal article by Gill in
1951 is the earliest in-depth discussion of programming errors, but
it does not use the term "bug" or "debugging". In the
ACM's 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.
Kidwell's article Stalking the Elusive Computer
Bug discusses the etymology of "bug" and "debug" in greater
detail.
Tools
Debugging is, in general, a cumbersome and tiring task. The debugging skill of the programmer is probably the biggest factor in the ability to debug a problem, but the difficulty of software debugging varies greatly with the programming language 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, re-start it, set breakpoints, change values in memory and even, in some cases, go back in time. The term debugger can also refer to the person who is doing the debugging.Generally,
high-level programming languages, such as
Java, make debugging easier, because they have features such as
exception
handling that make real sources of erratic behaviour easier to
spot. In lower-level 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. Another example would be to perform strong type
checking when the language does not require such. 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 (e.g., computer
hardware) as well as low-level software (e.g., BIOSes, device
drivers) and firmware, instruments such as
oscilloscopes,
logic
analyzers or in-circuit
emulators (ICEs) are often used, alone or in combination. An
ICE may perform many of the typical software debugger's tasks on
low-level software and
firmware.
Debugging process
The debugging is started by trying to reproduce the problem. This can be a non-trivial task, for example in case of 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 needs 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
divide-and-conquer 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 GUI,
the programmer will try to skip some user interaction from the
original problem description and check if remaining actions are
sufficient for bug to appear. To automate test case simplification,
delta
debugging methods can be used.
After the test case is sufficiently simplified, a
programmer can use debugger to examine program
states (values of variables, call stack)
and track down the origin of the problem. Alternatively a tracing
can be used. In simple case the tracing is just a few print
statements, which print out the values of variables in certain
points of program execution.
Remote debugging is the process of debugging a
program running on a system different than the debugger. To start
remote debugging, debugger connects to a remote system over a
network. Once connected, debugger can control the execution of the
program on the remote system and retrieve information about its
state.
Quotes
- The most effective debugging tool is still careful thought,
coupled with judiciously placed print statements.
- Brian Kernighan, "Unix for Beginners" (1979)
- Everyone knows that debugging is twice as hard as writing a
program in the first place. So if you're as clever as you can be
when you write it, how will you ever debug it?
- Brian Kernighan, "The Elements of Programming Style", 2nd edition, chapter 2
See also
portal Software TestingNotes
References
- Andreas Zeller: Why Programs Fail: A Guide to Systematic Debugging, Morgan Kaufmann, 2005. ISBN 1-55860-866-4
Further reading
- David J. Agans: Debugging: The Nine Indispensable Rules for Finding Even the Most Elusive Software and Hardware Problems, AMACOM, 2002. ISBN 0-8144-7168-4
- Bill Blunden: Software Exorcism: A Handbook for Debugging and Optimizing Legacy Code, APress, 2003. ISBN 1-59059-234-4
- Ann R. Ford, Toby J. Teorey: Practical Debugging in C++, Prentice Hall, 2002. ISBN 0-13-065394-2
- Robert C. Metzger: Debugging by Thinking : A Multidisciplinary Approach, Digital Press, 2003. ISBN 1-55558-307-5
- Glenford J Myers: *The Art of Software Testing, John Wiley & Sons inc, 2004. ISBN 0-471-04328-1
- John Robbins: Debugging Applications, Microsoft Press, 2000. ISBN 0-7356-0886-5
- Matthew A. Telles, Yuan Hsieh: The Science of Debugging, The Coriolis Group, 2001. ISBN 1-57610-917-8
External links
- Algorithmic and Automatic Debugging - extensive collection of links to debugging tools and methods
debug in Bulgarian: Дебъгване
debug in German: Debugging
debug in Spanish: Depuración de programas
debug in Persian: اشکالزدایی
debug in French: Débogage
debug in Korean: 디버그
debug in Indonesian: Debugging
debug in Italian: Debugging
debug in Hebrew: ניפוי שגיאות
debug in Japanese: デバッグ
debug in Polish: Debugowanie
debug in Portuguese: Depuração
debug in Russian: Отладка программы
debug in Finnish: Debuggaus
debug in Thai: ดีบัก
debug in Chinese: 调试
Synonyms, Antonyms and Related Words
answer,
bottom, clear up,
crack, decipher, decode, disentangle, divine, do, dope, dope out, explain, fathom, figure out, find out,
find the answer, find the solution, get, get right, guess, guess right, have it, hit
it, interpret, make
out, open the lock, plumb,
psych, psych out, puzzle
out, ravel, ravel out,
resolve, riddle, solve, sort out, undo, unlock, unravel, unriddle, unscramble, untangle, untwist, unweave, work, work
out