Yesterday's post covered two big problems in debugging, mostly having to do with theories. There are two other big problems with theories that you should be on the lookup for: improbability and missing walls. Scientists, when attempting to explain a phenomena, use an interesting criterion, parsimony. Essentially it says, if you have two theories and one is simpler, it should be preferred. Parsimony is ultimately about probability, since nature seems to prefer simple solutions. Computer problems don't always wind up having the most simple explanations, since they are built by humans and not the Flying Spaghetti Monster, but they do often wind up having the most probable explanation.
When trying to debug a problem, you need to ask yourself, "is the theory that I am proposing the most likely thing that could be going wrong here?" Novice debuggers tend to forget about what's probable in their hope that they will have an opportunity to find and fix that killer bug that they can brag about in a war story. However, you will get traction more quickly if you look at the most probable causes first.
The last issue that I'd like to cover is that of theories that are missing a wall. Often, a developer will approach me and say, "I've narrowed it down to cause X". I'll look over the data they've collected and talk through the issues. Along the way, I notice something interesting: while the cause they describe matches the data, it occurs to me that there is at least one other probable and plausible theory. Essentially, they haven't ruled enough out and so I tell them that their theory is missing a wall. There is clearly a piece of data that could be collected that would quickly distinguish between these alternatives. Noticing a missing wall is a learned skill, but it's one reason why it's always nice to have a trusted coworker whom you can run theories by. It's always surprising when someone else points out an obvious alternative explanation.
Tomorrow: Look at the Changes
