Debugging being a reactive process cannot be planned

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: moving breakpoints after any program statement. You may even set multiple breakpoints, and set or remove breakpoints when the program execution stops and waits for your further command at a breakpoint. 2. Watchpoint. Suppose a program contains a variable named "radius" whose initial value of 5 is not supposed to change during execution of the program or after some point in the program. But during debugging of the program you discover that its value is changing and you want to know the exact point in the program where its value gets changed. In such a situation, you can tell the debugger that "radius" is a watch variable. That is, you are telling the debugger to keep track of the variable "radius" and the moment its value changes, stop and give me control. The debugger will immediately stop after the statement that causes the value of the variable "radius" to change and will await your further command. Both kinds of checkpoints are very helpful in detecting logic errors in programs. Using Memory Dump This approach is normally used when the program "hangs up" during a test run. In this approach, a printout of the contents of main memory and registers is taken at the time when the program hangs up. This printout is called a memory dump or storage dump. The memory dump lists the instructions and data held in the computer's main memory in their raw form, that is, their binary or equivalent hexadecimal or octal form. The cause of the problem is very likely to be detected by doing a proper analysis of this listing. Difference Between Testing and Debugging Since both testing and debugging deal with program errors, many people often confuse between these two terms. The discussion above has clearly indicated that testing and debugging are two separate tasks. The points listed in Figure 13.1 further clarify the difference between the two. SI. Testing Debugging No. 1 2 Testing is the process of validating the correctness of a program. Its objective is to demonstrate that the program meets its design speci...
View Full Document

Ask a homework question - tutors are online