Debugging
Debugging is a process of removal of a defect. It occurs as a consequence of successful testing. Debugging process starts with execution of test cases. The actual test results are compared with the expected results. The debugging process attempts to find the lack of correspondence between actual and expected results. The suspected causes are identified and additional tests or regression tests are performed to make the system to work as per requirement.
Common approaches in debugging are :
- Brute force method
The memory dumps and run-time traces are examined and program with write statements is loaded to obtain clues to error causes. In this method “Let computer find the error” approach is used. This is the least efficient method of debugging.
- Backtracking method
This method is applicable to small programs.
In this method, the source code is examined by looking backwards from symptom to potential causes of errors.
- Cause elimination method
This method uses binary partitioning to reduce the number of locations where errors can exist.
Why debugging is so difficult ?
Following are some reasons that reveal why debugging is so difficult.
- The symptoms of bug may be present at some part (module) of the program and the its effect might be seen in some other module of the program. Hence tracing out the location of symptom becomes difficult.
- Symptoms may be caused by software developers during the development process. Such symptoms are difficult to trace out.
- The symptoms may appear due to timing problems instead of processing problem.
- If the developer corrects some error then the symptom may disappear temporarily.
- The symptom can appear if some in-accuracies in the program are simply rounded off.
- In real time systems, it is not possible to accurately reproduce the input conditions and this may lead to symptoms of bugs.
- The symptoms may appear periodically. Such things normally occur in embedded systems in which hardware and software is coupled.
- In distributed systems number of tasks are running on several distinct processors which may lead to symptoms.
No comments:
Post a Comment