Home > Uncategorised > Life And Death Balances Around the Letter E

Life And Death Balances Around the Letter E

August 30th, 2005 Leave a comment Go to comments

OK, so I write software for a living. I’ve always known that there are people out there who write some very critical software (e.g. Hospital heart monitors, Aeroplane control systems, etc, etc), but I’ve stayed clear of that so far, and instead my stuff is fairly non critical.

On Thursday of last week, I wrote a recursive procedure for something. We don’t use them very much on our project as there isn’t much need, but for my purposes, it suited it to a tee. I’d spent ages working on it, to make sure that it did eventually reach a base case, and therefore it wouldn’t end up looping infinitely.

Unfortunately, when I ran it, it blew up the database (to be more precise, the “Before Image” of that Webspeed Broker reached the maximum extent – for those of you who know Progress 4GL and Webspeed!). I eventually tracked it down to an error in the procedure which was causing it to loop infinitely. I was quite annoyed as I’d spent ages making sure this wouldn’t happen.

Anyway, I tracked down the bug to one line. Instead of checking if a date was greater than an input date (“GT” operator), I had checked if it was greater than or equal to the input date (“GE” operator). It’s amazing how much effect that one letter has.

Today, I was thinking, “Bloody hell, I blew up a database with one letter. What if I’d been writing Aeroplane controls. I would have killed several hundred people.” I know that those kind of software projects are formally specified, and have code reviews, etc, etc, but the potential is still there for this sort of thing to happen. Hopefully, this would have been found in testing, but things do slip the net (and quite frequently).

I’d better learn to type more accurately…..

Categories: Uncategorised Tags: ,
  1. No comments yet.
  1. No trackbacks yet.