Where did the objectivity go?

No, this is not a political column, rather another post on the topic of TDD.

A friend of mine and fellow architect wrote: “What about the loss of objectivity when a developer specifies his own test cases? It must require a conscientious mindset.” What about it? Fortunately, the blog format doesn’t require one to give answers rather one can just post opinions. I am debating this issue myself. How can we ask a developer to provide an all-inclusive set of tests even in the purely hypothetical case of a complete spec?

First of all, if we are following the mantra of TDD – add a test, get it to fail, and write code to pass the test – the initial set will not be complete. We then iterate in small steps to eventually achieve a sufficient level of confidence that the solution just meets the acceptance criteria set forth by the client. Thus, we asymptotically approach the perfect test set reaching it after an infinitesimal long time period or as soon as the system is decommissioned.

In a system of checks (unit testing) and balances (specs, QA, acceptance testing etc.), it also may be the wrong question to ask. However, now that unit testing can be sufficiently automated, I have seen a unit test suite being used as a (or even the) acceptance criterion for system releases. That would mean that one party would hold both legislative and executive powers, and in addition attempts to dominate the jurisdiction. For some people in politics that may be a desirable arrangement, but in software engineering it smell like disaster (one might argue that it is not such a good solution to run a country either – so politics and systems design have at least one thing in common after all)

As software has become pervasive in our lives, badly designed, buggy and applications that don’t meet requirements have pervaded our computers much more than well designed, stable, and software that meets our needs. Of course, everybody would expect a solid Microsoft product bashing next but quite frankly, I have seen some appalling solutions on Linux, OS X, Symbian, Palm, and Windows. It doesn’t make a difference.

Defining a system in objective terms and deriving acceptance criteria is hard enough. Eliminating subjectivity seems only achievable by eliminating manual intervention, i.e., by automation. I have not seen a black box solution – problem definition, ideas, and business process definitions in, automated acceptance test out. That might be something worth working on though. I’m pretty sure, users would appreciate a well defined level of confidence for all software – not just the one that flies airplanes, and controls power plants; provided we can provide it a fraction of their cost.

So don’t call me this afternoon, I’m getting right on it.