what is debugging
DEBUGGING:
After a failure has been
detected, it is necessary to first identify the program statement(s) that are in error and are
responsible for the failure, the error can then be fixed. In this Section, we shall summarise the
important approaches that are available to identify the error locations. Each of these approaches
has its own advantages and disadvantages and therefore each will be useful in appropriate
circumstances. We also provide some guidelines for effective debugging.
What is DEBUGGING:
A DEBUGGING is a computer program used
by programmers to test and debug a target program. Debuggers may use
instruction-set simulators, rather than running a program directly on the
processor to achieve a higher level of control over its execution. This allows
debuggers to stop or halt the program according to specific conditions.
However, use of simulators decreases execution speed.
Debugging Approaches:
The
following debugging Approaches are some of the approaches that are popularly adopted by the
programmers for debugging:
Brute force method:
This is the most common
method of debugging but is the least efficient method. In this approach, print
statements are inserted throughout the program to print the intermediate values with the hope that
some of the printed values will help to identify the statement in error. This approach becomes
more systematic with the use of a symbolic debugger (also called a source code debugger),
because values of different variables can be easily checked and break points and watchpoints can
be easily set to test the values of variables effortlessly. Single stepping using a symbolic a debugger is another form of this approach, where the developer mentally computes the expected result after every source instruction and checks whether the same is
computed by single-stepping through the program.
No comments:
Post a Comment