July 12, 2014

Chappell's Fourth Law of Programming

(One from the archives. I wrote this ten years ago. I think it still stands.)

Software quality, that marvelous thing that every programmer seeks for, as I explain in my third law of programming is all about caring. The only problem is that while "quality is caring", there have to be actions that this caring drives you to. The first and most important of these actions is unit testing.

Unit testing is the first tollbooth on the road to software quality.

I like to describe unit testing as a toll booth because there is a price to pay for quality. This price is typically non-monetary, but nevertheless very real. The analogy of a road seems to fit software quality very well. Software quality is not a one time thing, it is a journey to a destination. The toll booths on the road to software quality are the price that we must pay, the efforts that we must make, to complete that journey.

Journeys have three phases, the beginning, the travelling and the arriving. Unit testing is the beginning, the price of admission, that first tollbooth which permits you to drive on the road. With toll roads there is no free travel. You pay the toll to get on the road, you pay regularly as you travel along the road and then you pay again to exit the road.

There is no free lunch, or TANSTAAFL as the Perl guys like to say. If you want to do anything well, it's going to cost you time, effort, money or all three. Software quality follows this fundamental law of life.

Tags: Software Geeky One From The Archives