Debugging is fun?

Ibm has had a couple of very interesting articles on developerworks lately, today this came in: Learn the essentials of debugging

Since I have had “issues” with debugging, I decided it would probably worth a read.

Indeed it was. Even though – much like my favorite java book – for now all that was said seemed so “oh yes that is what I am doing/trying to do” not much news to me. But it’s much nicer to find a well-written organized article on the topic to refer others to than writing my own unpolished blogpost.

The most troubling thing to me is that many students — and even commercial coders — seem to freeze when unexpected problems arise. Some literally try making random changes or, worse, try to run the program a few more times in hopes that it will start to work again. These actions illustrate two primary issues: They have no idea how to approach debugging, and they have no confidence that they can nail the problem. I hope to ameliorate the situation by providing a clear approach that programmers can follow, or at least a place to begin.

After introducing the problem he goes on to explain by example how he works and which skills he is applying to a bug. Here’s the list of important steps in debugging:

1. Reproducibility.
2. Reduction.
3. Deduction.
4. Experimentation.
5. Experience.
6. Tenacity.

He concludes with my latest personal enlightenment on debugging. I remember saying the very same thing just two weeks ago:

I approach a nasty problem as if it were an interesting or challenging mystery to solve

Except I said: “I must learn how to ….” and I think I am learning how to debug more successfully.