UrbanPro
true

Learn Computer from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

What is debugging? and its importance

Vihanga EmbedSoft
13/07/2019 0 0

Debugging is a step by step process of identifying the errors present in the code.  The question here is what kind of mistakes? Usually errors are of two types.
1. Syntax errors
2. Logical errors.
Syntax errors are those where an error present in the syntax of a construct of a language. Such errors are identified by a compiler.
 Logical errors are those where an error present in the logic of the software problem statement. i.e. Software program runs but produces incorrect output.
 Logical errors are identified by the debugging process.  

How to perform Debugging?
 Debugging is not rocket science. It is straightforward. One who knows the software programming knows the debugging activity, but do not see the activity they are performing is debugging.  Let me explain with an example.
 Consider an example C Program of finding a square root of a number without using an SQRT function. Usually, the code for this program is around 20 lines.
 Anyone who writes the program will follow three steps. i.e.
1. read inputs
2. process inputs to produce outputs
3. Display outputs
To read inputs from the console in C, one uses scanf() function.
Similarly to display the outputs on the console, one uses printf() function.
Process operation contains different control structures, loops etc..
On completing the program, one tries to run it to see the written program is correct or not.
 To check that, one need to give input value to the program say 9. The square root of 9 is three, but the program is displaying other than 3. Now we know that the program is written is not performing Square root functionality correctly.  Next step we do is we start analysing the code by printing intermediate values of the logic with the help of the print() function and re-run the program.  Now you see the intermediate output displayed correctly or not.  If correct, then you know the logic written up to this point is right. Then shift the print() function down and check again.  Repeat the process until you find that the intermediate output is deviating from the correct output.  It is the area we know that computation is going wrong.
 This process is called Debugging. Identifying where the error accurately is called localising and correcting the error is called Fixing.  Therefore to summarise, Debugging process constitutes Debugging, Localizing and Fixing.
 Instead of placing printf() statement in the code, there are tools available. With these tools, one can mark a breakpoint and run the program up to that point and check the intermediate output variables or one can run the program statement by statement called step by step method. These features help you to identify the logical errors quickly.

Importance of Debugging?
 Usually, logical errors are complicated to remove and consumes more time in the projects to eliminate them.  So debugging process helps one to identify the logical error and eliminate them quickly.
 Finally,  with excellent Debugging skills, an average programmer/Tester become gets an extra-ordinary rating. But without debugging skills, an extra-ordinary programmer/Tester looks very ordinary.

0 Dislike
Follow 3

Please Enter a comment

Submit

Other Lessons for You

WHAT IS TESTING?
Checking anything with certain requirements & other feasible conditions, if user’s requirement is fulfilled customer will be satisfied otherwise opt for other options. Ex: Purchasing new...

Puzzle: A black man dressed all in black, wearing a black mask, stands at a crossroads in a totally black-painted to..........
Puzzle: A black man dressed all in black, wearing a black mask, stands at a crossroads in a totally black-painted town. All of the streetlights in town are broken. There is no moon. A black-painted car...

How to learn oops
OOP or Object Oriented Programming is a concept based on real life. Why is it so difficult to learn? Because it is so easy that we think "aw it cant be that easy, aiyoo!". But believe me, it is very easy...

Puzzle: What will be the angle on 3:15pm??
Puzzle: What will be the angle on 3:15pm??Solution:7.5 degrees.The hour hand moves around the clock every 12 hours,i.e. 360 degrees in 12 hours or can say 30 degrees per hour. The hour hand covered ¼...

Puzzle:There are three boxes. One is labeled apples, another is labeled oranges. The last one is labeled apples an..................
Puzzle: There are three boxes. One is labeled apples, another is labeled oranges. The last one is labeled apples and oranges. You know that each one is labeled incorrectly. You may ask me to pick one fruit...
X

Looking for Computer Classes?

The best tutors for Computer Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn Computer with the Best Tutors

The best Tutors for Computer Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more