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: 162Word Count: 523See All articles From Author

Add Comment

Technology, Gadget and Science Articles

1. Restaurant Management System
Author: sidharthh

2. A Step-by-step Guide To Implementing A Cryptocurrency Exchange Script
Author: Marccochatt

3. Is Your Business Missing Out On A Vendor Management Tool?
Author: nagaraj

4. Why Is An Effective Request For Quotation (rfq) Process Crucial For Procurement?
Author: nagaraj

5. 10 Proven Strategies To Increase Your App Installs
Author: boonapps

6. Underground Marine Life Discovered Near Hydrothermal Vents
Author: luminarytimes

7. 6 Tools To Help You Manage Your Shopify Sitemap Effectively
Author: Hans Dominguez

8. Building A Conversational Ai Chatbot With Dialogflow
Author: QSS Technosoft

9. Qualcomm Unveils Snapdragon 8 Elite Chip With Enhanced Ai Capabilities
Author: theleadersglobe

10. What You Can Expect From The Poly(methyl Methacrylate) Microspheres?
Author: Alpha Nanotech Inc.

11. Sinosteel Pipe Invites You To Visit Metal-expo’2024 30th International Industrial Exhibition
Author: Sinosteel Pipe

12. Why Your Business Needs E-procurement Software For Direct And Indirect Procurement
Author: nagaraj

13. Analysis Of The Causes Of Large Ripple In The Power Supply Of Commonly Used Electronic Equipment
Author: Luosi

14. Acumatica Consulting: Empowering Your Business With Cloud Erp
Author: gleb andreev

15. The Role Of Asterisk Development In Transforming Voip Solutions
Author: James Taylor

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