Test Happens

As the saying goes, test happens. Sometimes it happens because the developer writes and runs the tests at the same time he's writing the code. When this happens, bugs get found quickly. And they fixed quickly, when it's cheap and easy. Life is good.

Sometimes, it happens when the code gets thrown over the wall to the QA department. This might be a few days later. In some shops, it might be weeks or months later. By that time, the developer who wrote the bug has probably forgotten everything about the code and has to spend time getting his or her head around the problem again. That's if you're lucky. If you're unlucky, he or she has moved on to a different project. Or a different company. This costs a bunch more than the first scenario.

Even worse is if additional code has been written which depends on the buggy behavior. Now you've got to go fix additional code all over creation. Or figure out some way to retrofit the bug fix into the code without breaking other things. More expensive.

Sometimes, when the test really hits the fan, it doesn't happen until the software is installed at the customer site. You know the customer I'm talking about. The one who is nine times zones away. The one who is on the verge of signing a big contract renewal but won't write the check until you can solve this problem.  Yeah, that customer. BTDT. Not fun.

Maybe you're not that kind of company. Maybe you're a start-up building the next killer web site. In that case, it'll happen when you're demoing the site to the VC who is supposed to be the lead investor for your third round. It really sucks to be you when all you can show the guy is a 503 page.

I don't quite understand why1, but most programmers don't like testing. Perhaps they think it's boring, or a waste of time, or just plain unglamorous. Whatever the reason, most developers don't do much testing, which is a shame. It can be fun, challenging, and if done right, very rewarding. If done wrong, it can be mind-numbingly boring, expensive, and unlikely to find any bugs. It can make you run out and buy books like this one.

So, we're back to testing our own stuff. Which is what I intend to talk about a bunch in future installment.

1 Actually, I do have some idea, but I'll hold that for a future installment as well.