APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

2005/04/21 debugging, debugger

© April 2005 Tony Lawrence

Debugging is the process of figuring out why a series of events that apparently should have led to X did not. I recently came across an interesting page devoted to Algorithmic and Automatic Debugging. Just the sheer number of links on the page shows how much we poor humans need debugging assistance.

Sometimes, program failures are simple failures of knowledge: either we don't understand the language we are using or we don't understand some structure or underlying hardware that our programs are working with. That's probably where debuggers are most useful: if we expect X to have value Y at some point in our program, a debugger (or even just a well placed "print" or "assert" macro) can help us find out why it had some other value instead. But the really unpleasant failures come from logical or algorithmic failures: we're checking under the candy wrapper trying to find an elephant. It's not going to be there no matter how "correct" our program is at lifting up candy wrappers and recognizing trunks and tusks thus exposed. Those are the programs that are really hard to debug, because there's nothing necessarily wrong at all except for the implicit assumption that an elephant can be hidden under a candy wrapper.

Humans vary widely in their ability to "debug". The skill is really no different than that portrayed in any "detective" movie: you gather facts, apply logic, and figure out what must be happening. With program debugging, you often have the advantage of being able to replay a situation with different conditions, which may give you more clues as to the problem. For example, if a computer seems to be totally dead, plugging it into a different wall outlet or plugging a known working device into its outlet might immediately solve the problem. For most of the people reading this, that kind of testing (and more) is pretty obvious, yet I am continually amazed at how many people can't come up with logical test procedures by themselves. It's not lack of intelligence necessarily; I've seen horrible debugging skills in people I think of as extremely bright - people who ARE extremely bright by any other measure, yet become helpless when presented with situations that would be trivial for many of the "geek" types apt to be reading this.

See Basic Troubleshooting also.

Got something to add? Send me email.

(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

-> debugging, debugger

Inexpensive and informative Apple related e-books:

Take Control of the Mac Command Line with Terminal, Second Edition

Take control of Apple TV, Second Edition

Photos: A Take Control Crash Course

Take Control of Preview

Take Control of Parallels Desktop 12

More Articles by © Tony Lawrence

Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us

Printer Friendly Version

Several people have told me that my inability to suffer fools gladly is one of my main weaknesses. ((Edsger W. Dijkstra)

Linux posts

Troubleshooting posts

This post tagged:


Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode