A couple of nights ago I had a very salutory lesson in the importance of testing. It's nothing to do with developing software, but the same principles apply.
I bought a new TV card for my PC, so needed to run a TV cable down to my study so that I could watch Euro 2004 whilst working on my PC. I already had a TV feed in the loft which split in two - one into my bedroom, one into the guest bedroom, so I decided to re-route the guest bedroom cable.
One quick bit of drilling later, I ran the auto-tuner on the TV card, and successfully found Channels 1-5 (for American readers, we only get 5 channels over the normal airbourne TV signal in the UK). Unfortunately the signal from my satellite TV box wasn't being picked up by my TV card.
The TV in my bedroom was tuned in to the satellite feed OK, so I couldn't see what the problem was. I spent the next two hours playing with TV card settings, updating the card BIOS, downloading and experimenting with third party tuners and PAL signal formats, Googling for problems with my TV card, and so on. I also made a few trips up into the loft to swap cabling around, earning myself a few tiny but painful cuts from the loft insulation into the bargain.
Finally I decided on something I should have done right up front, when I first had problems: I brought my heavy TV from the bedroom to the study, something I'd delayed doing because it was a bit awkward to carry. To my surprise, I couldn't get a satellite signal on it in the study either, despite it working fine in my bedroom.
So - back up I went in the loft with a torch to have a far closer look at the cabling. Turns out that for the last two years of living here, I'd had my mental map of the cabling totally wrong. Where the cable disappeared into the dark corner of the loft and underneath some insulation, it had a hidden splitter in it, and was run downstairs to the satellite TV box then back upstairs to my bedroom. Because the corner was dark, I hadn't seen the split - it simply looked like the cable disappeared under the insulation, back out again, and into the guest bedroom.
It's pretty clear how the morals of this transfer to software development:
Don't rely on assumptions - just because you "know" it, doesn't mean it's right.
Make sure you look into dark corners, even if it means metaphorically crawling around with a torch.
Make sure that you test components properly, individually, and early, even if the testing is going to be a bit awkward.
Hopefully if you follow these simple rules, not only will your code have less bugs, but you won't miss Germany v Holland in the European Championships. Oh well!