Blog Tags: 

Bug hunting with the scientific method

I've never come across a problem I couldn't solve using the following technique / problem solving methodology, and I've come across some tough ones.

As much as I might like to, I can't take credit for developing this stuff myself, as it is basically the same pattern that drives all modern science and engineering. I figured if it works for finding out the mathematical laws of the universe, developing nuclear weaponry and space flight, I could probably put it to work to solve my rather humble set of problems as well. It hasn't failed me yet.

I use the scientific method to test my assumptions, when coming across unexpected behaviors, gotchas, bugs, or when I simply don't understand what is going on in a general sense.

In a nutshell, I try to figure out how to break down what is happening into smaller pieces, preferably reducing the complexity of the test case and isolating the behavior I do not understand to the simplest case possible in which it is still exhibited.

Then after I have reduced the monster into a more manageable-sized demon, I attack it with experimentation.

I ask myself: what are my best guesses for what is causing this undesirable behavior? I form reasonable hypotheses. Then I plan for doing a range of experiments that will either validate or invalidate my hypothesis.

The experiments are preferably as simple as possible while still shedding light on the problem, but no simpler.

Add new comment