Debugging: Programming Allows You To Think About Thinking, and While Debugging You Learn Learning
Debugging: Programming Allows You To Think About Thinking, and While Debugging You Learn Learning
Programming allows you to think about thinking, and while debugging you learn learning
Group members:
62. Pramod Baviskar
64. Akshay Savad
65. Neel Suba
67. Aakarsh Verma
What is debugging?
Software programs undergo heavy testing, updating, troubleshooting, and maintenance during the development
process. Usually, the software contains errors and bugs, which are routinely removed.
Debugging is the process of detecting and removing of existing and potential errors (also called as ‘bugs’) in a
software code that can cause it to behave unexpectedly or crash.
It refers to identifying, analyzing and removing errors. This process begins after the software fails to execute
properly and concludes by solving the problem and successfully testing the software. But, it is considered to be an
extremely complex and tedious task because errors need to be resolved at all stages of debugging
Purpose of Debugging
To prevent incorrect operation of a software or system, debugging is used to find and resolve bugs or
defects. When various subsystems or modules are tightly coupled, debugging becomes harder as any
change in one module may cause more bugs to appear in another. Sometimes it takes more time to
debug a program than to code it.
Without Debugging it is very difficult to understand and figure out where unlikely errors will be found on
the code of our application, because while coding we are concentrated on the functions rather than those
unlikely errors.
Steps involved in debugging
1. Identify the Error: A bad identification of an error can lead to wasted developing time. It is usual that production errors reported by users
are hard to interpret and sometimes the information we receive is misleading. It is import to identify the actual error.
2. Find the Error Location: After identifying the error correctly, you need to go through the code to find the exact spot where the error is
located. In this stage, you need to focus on finding the error instead of understanding it.
3. Analyze the Error: In the third step, you need to use a bottom-up approach from the error location and analyze the code. This helps you
in understanding the error. Analyzing a bug has two main goals, such as checking around the error for other errors to be found, and to make
sure about the risks of entering any collateral damage in the fix.
4. Prove the Analysis: Once you are done analyzing the original bug, you need to find a few more errors that may appear on the
application. This step is about writing automated tests for these areas with the help of a test framework.
5. Cover Lateral Damage: In this stage, you need to create or gather all the unit tests for the code where you are going to make changes.
Now, if you run these unit tests, they all should pass.
6. Fix & Validate: The final stage is the fix all the errors and run all the test scripts to check if they all pass.
Debugging Strategies
● It is important to study the system in depth in order to understand the system. It helps the debugger to
construct different representations of systems that are to be debugged.
● Backward analysis of the problem traces the program backward from the location of failure message in
order to identify the region of faulty code. You need to study the region of defect thoroughly to find the cause
of defects.
● Forward analysis of the program involves tracking the program forward using breakpoints or print
statements at different points in the program. It is important to focus on the region where the wrong outputs
are obtained.
● You must use the past experience of the software to check for similar problems. The success of this
approach depends on the expertise of the debugger.
Advantages and Disadvantages
Advantages
Disadvantages
Hence the process of Debugging is a vital part of creation and maintenance of any software
application as much as writing the necessary code for it to run. Debugging ensures that the
software will continue to run smoothly despite possible difficulties it may experience.
Although debugging is an efficient process to figure out issues and problems with the code,
many simple errors can be solved without ever touching the debugger. To make the process
of software development quick, debugging should be used as a last resort when the
programmer is not able to directly figure out the malfunctioning code.