Pages

Wednesday, November 27, 2013

Debugging (Part 1)

The word bug is used to represent something which is an object of terror. It was first introduced by Rear Admiral Dr. Grace Hopper, the inventor of COBOL. He was the first person to find out a ‘bug’ (a moth caught in a relay!!) in a computer system.

Bugs are still there in computer systems, even though they are not the flying ones! Software defects happen in many ways, from misunderstood requirements to coding errors. 

Modern computer systems are still limited to doing what you tell them to do, not necessarily what you want them to do.

No one writes perfect software. Here we can discuss about the issues related to debugging and about the strategies used for finding elusive bugs.

Psychology of Debugging

For many developers, debugging is a sensitive and emotional subject. People look for others to blame on bugs. Working on someone else’s bug is not the time to blame them. Consider it as problem solving, which helps us to improve ourselves.

Fix the Problem, Not the Blame

Debugging Mindset

We have to have the right mindset before we start debugging. We should be free from all other pressures and distractions. Be comfortable and remember the first rule of debugging:

Don't Panic

There could be many reasons (like facing a deadline) to get into panic. Be calm and think twice before starting. Don’t try to fix the symptoms you see. The actual cause might be somewhere else and the symptom could only be a result of that. Instead of jumping in to fix the symptoms, try to go deep and find the root cause and fix it.

Find and fix the cause, not symptoms…


- summary of Debugging, from The Pragmatic Programmer: from Journeyman to Master

No comments:

Post a Comment