Footprints in the Sand

Footprints in the Sand

About Programming, the World at Large and the Meaning of Life.

Or, to be more specific: About whatever I feel like. Don't say you weren't warned.

The Case for Testing Trivial Functionality

Testing Posted by Petter Hesselberg Tue, May 08, 2007 09:29

Is any code so trivial that testing it is a waste of time?

In theory, possibly. In real life, no code is ever that trivial -- Real Life has this distressing tendency to turn around and bite your ass when you're not watching.

The article needs formatting not available on this blog; you'll find it here:


Undocumented Features (aka Bugs)

Testing Posted by Petter Hesselberg Mon, May 07, 2007 12:46

Here's one appropriate response when somebody requests a change to a program:

"A bug? What do you mean, a bug? That's not a bug; that's an undocumented feature. Now go away and stop bothering me." (Turn away, mutter to self.)

Here's another appropriate response:

"A broken test, you say? Aye, aye, sir, ma'm; yes, yes, YES! I'm all over it, right away!"

The moral? A bug is not a bug until you have a broken test to prove it. If you don't like the behavior of your program, create a broken test. Then (and only then) are you allowed to change the behavior, by fixing the test.

And if fixing the test didn't result in the desired behavior, you had the wrong test to begin with.