An oversimplified description of my job as a computer programmer goes something like this.
- I get some requirements for a program from my boss or a client.
- I write the program as perfectly as I can.
- I test the program with all the cases that I think it will need to handle.
- The program is done and people start using it.
- 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.
- 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.