ALL >> Technology,-Gadget-and-Science >> View Article
Debugging Source Code And Its Various Approaches For The Layman

Once errors are identified, it is necessary to first locate the precise program statements responsible for the errors and then fix them. Generally, the most difficult part of debugging is locating the invalid part of the source code. Once the error is found, correcting it is usually easy. Generally, debugging is a lengthy and tiresome task. The debugging skill of the programmer is probably the biggest factor in the ability to debug a problem.
There are several approaches for debugging. Programs known as debuggers exist to help programmers locate bugs. Debuggers enable the programmer to monitor the execution of a program, stop it, re-start it, set breakpoints, change values in memory and even, in some cases, go back in time. For debugging computer hardware and low-level software like device drivers, BIOS and firmware, instruments such as oscilloscopes, in-circuit emulators are frequently used.
Brute Force method is, though, the most common method of debugging, it is the least efficient method. In this approach, the program is loaded with print statements 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 known as source code debugger), because the values of different variables can be easily checked and break points and watch points can be easily set to test the values of variables effortlessly.
Backtracking is also a fairly common approach. In this approach, beginning from the statement at which an error symptom is observed, the source code is traced backwards until the error is discovered. Unfortunately, as the number of source lines to be traced back increases, the number of potential backward paths increases and may become unmanageable large, thus limiting the use of this approach.
In Cause elimination method, a list of causes which could possibly have contributed to the error symptom is developed and tests are conducted to eliminate each cause. A related technique of identification of the error from the error symptom in the software fault tree analysis.
Program slicing is a technique which is similar to back tracking. However, the search space is reduced by defining slices. A slice of a program from a particular variable at a particular statement is the set of source lines preceding this statement that can influence the value of that variable.
Debugging is often carried out by programmers based on their ingenuity. Many a times, debugging requires a thorough understanding of the program design. Trying to debug based on a partial understanding of the system design and implementation may require an inordinate amount of effort to be put into debugging even for simple reasons. Debugging may sometimes even require full redesign of the system. In such cases, a common mistake that novice programmers often make is that they do not attempt to fix the error but only its symptoms. One must be beware of the possibility that any one error correction may introduce new errors. Therefore, after every round of error fixing, regression testing must be carried out.
About the Author:
Computer Juice offers a community of like minded individuals so you can get help for your computer problems. Visit us at - http://www.computer-juice.com/ or http://www.computer-juice.com/forums/.
Add Comment
Technology, Gadget and Science Articles
1. Just Eat Data Scraping Services For Reviews & Pricing TrendsAuthor: Web Data Crawler
2. Ubereats Restaurant Data Scraping Apis For Food Tech Growth
Author: Den Rediant
3. The Future Of Chatbot Development: Conversational Ai For Every Industry
Author: michaeljohnson
4. Unlock Taco Bell Menu Data With Regional Pricing Insights
Author: Real Data API
5. Sustainable Farming And Crop Protection Chemicals In Asia-pacific
Author: Suvarna
6. About Quantum: Quantum’s Vision For Logistics Transformation
Author: Quantum BSO
7. Transforming Awards With The Best Award Management System
Author: Awardocado
8. Stay In Control Of Your Warehouse Stock
Author: Focus Softnet
9. Air Purifier Benefits: Why Every Modern Home Needs One
Author: Marry Roser
10. Meta's Ai Chatbots: A Vision Of Universal Availability In The Near Future
Author: Sdreatech
11. 5 Essential Ai Data Collection Strategies That Actually Work
Author: Macgence AI
12. Crafting Seamless Experiences With A Future-ready Event Management Website
Author: Enseur Tech
13. The Greatest Change Agent In Modern Logistics And Supply Chain Transformation
Author: Quantum BSO
14. Uber Eats Data Scraping For Menus And Pricing Insights
Author: Retail Scrape
15. Asia-pacific Industrial Automation Market To 2032: Growth Drivers, Opportunities & Challenges
Author: Suvarna