The process of attempting to determine the cause of the symptoms of malfunctions in a program or other system. These symptoms may be detected during testing or use by real users.
Symptoms are often caused by factors outside the program, such as misconfiguration of the user's operating system, misunderstanding by the user (see PEBCAK) or failures in other external systems on which the program relies. Some of these are more in the realm of technical support but need to be eliminated. Debugging really starts when it has been established that the program is not behaving according to its specification (which may be formal or informal). It can be done by visual inspection of the source code, debugging by printf or using a debugger. The result may be that the program is actually behaving as specified but that the spec is wrong or the requirements on which it was based were deficient in some way (see BAD).
Once a bug has been identified and a fix applied, the program must be tested to determine whether the bug is really fixed and what effects the changes have had on other aspects of the program's operation (see regression testing).
The term is said to have been coined by Grace Hopper, based on the term "bug".