If the testing phase signals the presence of logical errors, or if we are not able to detect the cause for a runtime error, it is necessary to debug the program.
There are two ways in which we can obtain information that is helpful for debugging a program: