Debugging in Software Testing | Debugging Approaches
What is debugging ?
- Debugging is the activity performed by the developer to fix the bug found in the system .
- BUG : It is a type of error , system that it causes it to produce an incorrect or unexpected result .
- Whenever any failure is detected , first it is necessary to identify the program statements that are in error and are responsible for causing the failure the error can then be fixed .
- Debugging process is not a process of Testing but it is the result of testing.
Debugging Approaches :
There are basically 3 debugging approaches as given below :-
- Bruteforce Method
- Backtracking Method
- Cause Elimination Method
- Bruteforce Method :-
- Bruteforce is commonly used and least efficient method for separating the cause of software error .
- This is the most commonly used method of debugging .
- In this method , print statements are inserted throughout the program to print intermediate values with the assumption that some of the printed values will help to identify the error.
2. Backtracking Method :-
- Backtracking is successfully used in small programs .
- In this approach , beginning from the statement at which an error symptoms has been observed , the source code is traces backward until the error having large amount of codes.
- It will become more complex to trace backward for softwares having large amount of codes .
3. Cause Elimination Mehod :-
- In this approach , once failure is observed , the symptoms of the failure are noted , Based on the failure symptoms the cause which could possibly have contributed to the symptoms is developed and test are conducted to eliminate each .
- In this approach , once failure is observed , the symptoms of the failure are noted , Based on the failure symptoms the cause which could possibly have contributed to the symptoms is developed and test are conducted to eliminate each .
Debugging Stratergies :
- Realize that you got a bug / error .
- Reproduce / Generate the input values that causing the error.
- isolate that functionality of the software or part of your code .
- Debug that code
- Check for code is working fine or not.