Contrary to things made in a factory, software is never finished and put into mass production. We never stop adding features and evolving it. It reminds of a living thing. And living things needs an immune system to survive. That is what the tests suite is! Your defence against the continuous deterioration that constant tinkering brings.
Software is never finished. The idea of industrial production, when we construct a thing, and then make loads of copies of it, does not apply to software.
The industrial way of thinking is that when we have a need, we make a thing. If we have another need, we made another thing. For instance, we made a pen to write with. But to write text that we could erase, we had to make a pencil. We write on paper. White paper and coloured paper are two different products. Want lines to write on? Yet another product. And so on.
A computer program on the other hand isn’t constrained by manufacturing machines or raw materials. It doesn’t have any limitations to what it can do. We take advantage of that and keep adding new features. For instance, look at your average word processor. It writes, erases, changes colour on the background, adds lines, and splits the text into columns, or back if you change your mind. On top of that, it prints to a printer. And as if that wasn’t enough, it spell checks.
If you think of any new functionality that is useful, you just add it to the next version, and it is automatically downloaded directly to your computer.
This means that, contrary to the pen, the design is never finished. You never just move on to serial production. In fact, there is no machine in a factory that constructs the individual pieces of software. The closest to this we’ve ever been is the diskettes and CD ROM, before internet. And yet, that was just the delivery medium that was produced by factories, not the software in itself.
There is always a next version, a new set of functions, a new look or just better performance. Not to mention bug fixes. We keep changing it all the time. That means that thinking of software quality in terms of old production lines, where you write the code and then test it, before you ship it and is done, just doesn’t work.
We have to rethink the concept of quality.
I look at software as an organic, yes almost living thing. It is always evolving, just like a child growing up. If it gets wounded, think bugs, we heal it, i.e., we correct the bugs. Heck, it can even get viruses.
To a living organism, an immune system is vital for survival. A good immune system can quickly find any problem with the organism and send the troop to handle it. We humans have things like white blood cells, antibodies and autophagy. Software has the automated test suite.
A system without automated tests is vulnerable to continuous changes. Each change you do is also a possibility that you add bugs to the system. And when we change the code all the time, that means that you constantly are exposed to new bugs.
Tests find errors
Without a proper automated test suite, you will have a hard time detecting errors. You won’t even know they’re there. And when the bugs are discovered, it is often the users that reports them. That would be like your friend telling you that you have spots on your skin, and it turns out that you have the measles.
Occasionally, you will find errors when you do your manual tests. But as I’ve touched on in previous articles, manual tests will never be as exhausting as the relentless testing that a machine can do. Let’s face it, you only test the thing that you are working on.
There is no way that you will get the time from any project to test everything all the time. Not even to test the most relevant parts of the system. And if you actually did, you will be bored to death, and rather quit the job than to perform all that tedious testing. It will never happen. It just won’t.
And you probably will get away with not testing it because it usually work.
Except when it doesn’t. And that’s when you should have done all that testing that you didn’t do.
To continue the comparison with humans, that would be like you doing a thorough inspection of your entire body, taking the temperature, and checking your blood values, several times a day, every day, to see if you have contracted any diseases.
An automated test suite is your softwares immune system. Always checking the health of the code and as soon as it discovers anything, it reports it so you, the developer, can mobilize and correct the problem before it reaches the customer where it can create real problems.
Evolution has taken software a really long way away from the old Ford production line, and turned into a giant organic, ever changing entity. And now, when software is networking and executing in big cloud clusters, the software immune system is needed more than ever.