The fun of chasing a bug, the horror of finding it.

Thursday, October 11 2007

Part of a programmers life is the time somebody comes to your office to report a problem. There are 2 types of "bug reporters" the one with a general idea about something going wrong and the one with screen shots and steps to reproduce it. Personally the second type is the one I hope you get.

At the early years of my career I resented that people, the ones with all the details or the ones with a general idea, I thought they were wasting my time as well I was embarrassed to get a bug. Now, I do know that I would get many, many bugs, so I'm expecting that visit, many, many times. If you come prepare with the steps to reproduce it and show it to me, you have already fix it in my book. Well 90% of the times..

Of course there are many bugs that take a long chase, and those, even a little stressful can be fun if at the end you are successful. Worse case if a bug not created by you and one that you don't have the source code or access to the problem, best case of course when is on the code you wrote. I do now wish for bugs that I created as they are easy to fix, instead of the ones where source code is not available to me.

You should follow the same rules the you like when reporting a bug to somebody else, Get the steps to reproduce it and create a little application if you can that will be simple for the person to follow, by doing that you also isolate the issue to make sure is not something you do that creates the bug. When the bug is accepted as a bug by that person, expect a timeline to fix it as by doing that, will be able to keep track of the progress. Ask the person to fix it on the application you provide it as this way you can verify the issue has been resolved.

Most of the time, you cannot submit the bug to be fix and you need to deal with that bug. At that moment,you should still create a little application isolating the bug, and wrap the functionality to "hack" it and fix it. Even if you believe you are fixing it, you are actually hacking it and you should treat it as such and still reporting it even if you know won't be fixed. A tip to you, when you believe you found the bug, check it again, most of the time, is something else, but programmers are human too, at least some. Feels like playing poker and you got a few As's on your hand, do not go all out, verify the results and prove the concept.

The whole process can actually be lots of fun, as there is something to be said at chasing bugs. Not just learning the issues, you can improve the code and performance as you go. The debugging process is the best teacher for the programmer. Going line by line and checking every object will give you a whole picture of your solution and next bug will be faster to find as you know where you should start looking.

Many other programmers I know, do not like debugging. Simple, get used to it!

Cheers

Al

Comments

TrackBack said on 10.12.2007 at 10:42 AM