Friday, March 10, 2006

The Funny Bug

First, a warning: If you are allergic to math, computers, or generally not a fan of geeky things... Stop reading this now.

Still with me? Okay, so today at work I saw one of the funniest software bugs in my short career. We make a set of map publishing tools, and one of the capabilities of these maps is to store data about each shape or area of the map. So in the course of testing, one of our QA guys discovered a bug in an election map. Basically each state had associated with it some attribute values for what percentage voted for Gore and what percentage voted for Bush. The bug was discovered when someone tried to use our expression engine to create a new attribute column that simply stored the result of adding the two percentages together. This expression looked like "PCTGORE + PCTBUSH". Simple enough, right? Well the engine evaluates expressions you put into it and reports back on any errors. In this case it spat back an error "bad token at position 0", which basically just means that it didn't recognize the "PCTGORE", even though it was a perfectly valid "column".

Half the development team was huddled around the QA guy's computer as we tried to figure out why it doesn't like Gore. It's pretty confounding because if you do "A + B" it works fine. Anyway, long story short, I had a eureka moment when I realized that "GORE" contains "OR" which is one of the permitted operands. We all laughed pretty hard at the initial notion that the computer didn't like Gore. I was given mad props for figuring it out. I felt quite smug and satisfied, and proceeded to tell the guys the story about a GM engineer who was sent to investigate a man's claim that his car wouldn't start if he went to the store to buy vanilla ice cream, but it would start fine if he bought chocolate. You can read that story here.

No comments: