123ArticleOnline Logo
Welcome to 123ArticleOnline.com!
ALL >> Technology,-Gadget-and-Science >> View Article

Debugging Source Code And Its Various Approaches For The Layman

Profile Picture
By Author: DJP Hybrid
Total Articles: 4393
Comment this article
Facebook ShareTwitter ShareGoogle+ ShareTwitter Share

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/.

Total Views: 264Word Count: 523See All articles From Author

Add Comment

Technology, Gadget and Science Articles

1. Best Paint Testing Lab In India For Industrial & Commercial Paint Analysis
Author: KINJAL

2. Best Laser Diode Machine For Skin Hair Removal Offered By Reveal Lasers
Author: reveallasers

3. Versitron M7275s-2a 10/100 Fiber Media Converter For Enterprise, Defense & Industrial Networks
Author: Versitron

4. Build Real-time Apis For Web Scraping Data Pipelines
Author: REAL DATA API

5. How To Scrape Complete Product Catalogs From E-commerce Websites For Multi-platform Product Tracking?
Author: Retail Scrape

6. Scrape Data From Quick Commerce Apps Instamart, Blinkit, & Zepto
Author: Retail Scrape

7. Best Ring Products Analytics On Amazon Saudi Arabia
Author: Actowiz Metrics

8. Schedule And Automate Data Extraction Jobs
Author: REAL DATA API

9. Automating The Employee Lifecycle With Smart Hcm Workflows
Author: Focus Softnet

10. Best Techniques For Dealing With Missing Values In Scraped Data
Author: REAL DATA API

11. Automated Retail Price Monitoring Using Web Scraping Apis
Author: Web Data Crawler

12. Why Awardocado Is The Smart Choice For Modern Award Management Software
Author: Awardocado

13. How Retailers Use Data Scraping To Win Price Wars
Author: REAL DATA API

14. Pricing Intelligence Via Airbnb Listing Data Scraping Data
Author: DataZivot

15. Building Interactive Dashboards For Scraped Data Analytics
Author: Web Data Crawler

Login To Account
Login Email:
Password:
Forgot Password?
New User?
Sign Up Newsletter
Email Address: