Friday, April 2, 2010

Sympathy For the Devil

Toyota has had quite a year so far. Now, experts from NASA have been called in to examine the computer systems and software in an attempt to figure out the cause of the sudden acceleration some cars experience. I'm really glad I don't have that job. Except that I kind of do. All working programmers do.

"What's puzzling you is the nature of my game." --Rolling Stones, Sympathy For the Devil

Programming is hard because it's complex: every detail matters all the time. And with this complexity comes the inevitable defects. We call them "bugs." Ideally, extensive design, reviews, and testing drive out all the critical bugs before any given product goes into production. But things are never really perfect, because the humans that build them aren't omniscient. And neither are the humans that use them. When market forces are involved (that is, money), even the definition of "critical bug" becomes a fluid thing. And guaranteed quality can be very expensive.

"Is this going to be a stand up fight, sir, or another bug hunt?" --Aliens

Bugs can come from the most innocuous of places, like a misplaced or missing character in a line of code, a typo in a specification, or any number of simple human mistakes. They can also come from unexpected external interactions, like electronics shorting when the power surges, or when the cleaning crew unplugs the it's-always-on computer once a week to plug in the vacuum, or the local horseflies land on and trigger a touch screen when the operator isn't in front of it, or when the color blind guy doesn't see the red-on-white annotation on the specification. (All based on true stories.) Finding and fixing these sorts of bugs resembles a combination of lab and detective work. If you can just get that one extra piece of information that will make the bug make sense, you can isolate it and fix it. Probably. Debugging makes up the lion's share of the drudgery of programming. Finding all the edge cases, closing all the logic holes, making the program bullet proof, it's all part of the job. And it's hard.

"Adjusting to the requirement for perfection is, I think, the most difficult part of learning to program." --Frederick Brooks, Jr. "The Tar Pit"

As a person, I can not overstate how bad it is that people have been hurt and killed by the problems with Toyota vehicles, but as a programmer, I feel for the people who are right now working as hard as they can to figure out what exactly is going wrong and why. Here's hoping they come across that elusive information they need to squash this particularly nasty bug.

No comments: