How was this working?

July 29, 2010 By: erik Category: Geeky, Programming, Weird

Friendly Bug!An oversimplified description of my job as a computer programmer goes something like this.

  1. I get some requirements for a program from my boss or a client.
  2. I write the program as perfectly as I can.
  3. I test the program with all the cases that I think it will need to handle.
  4. The program is done and people start using it.
  5. For whatever reason the requirements change (or a bug is found), and I have to go back and modify the code. Inevitably less testing is done on these changes than the original writing.
  6. Go to #4.

It’s pretty rare for the original writing of a program to have a significant bug in it after testing, although I’m not perfect. Almost all bugs are introduced in step #5. When you first write the program, the entire program and its relationship with other programs is in your mind. But when you go back to look at old code, it’s just not fresh in your memory, and it’s very easy to make a change without taking into consideration all the consequences that change will have.
(more…)