Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What helps to you improve your ability to find a bug?

Tags:

debugging

I want to know if there are method to quickly find bugs in the program.

It seems that the more you master the architecture of your software, the more quickly you can locate the bugs.

How the programmers improve their ability to find a bug?

like image 326
MainID Avatar asked Feb 22 '09 16:02

MainID


2 Answers

Logging, and unit tests. The more information you have about what happened, the easier it is to reproduce it. The more modular you can make your code, the easier it is to check that it really is misbehaving where you think it is, and then check that your fix solves the problem.

like image 72
Jon Skeet Avatar answered Oct 05 '22 20:10

Jon Skeet


Divide and conquer. Whenever you are debugging, you should be thinking about cutting down the possible locations of the problem. Every time you run the app, you should be trying to eliminate a possible source and zero in on the actual location. This can be done with logging, with a debugger, assertions, etc.

like image 26
twk Avatar answered Oct 05 '22 20:10

twk