In theory. Testing is not _the_ answer. Testing is one tool in
the creation of dependable software. As software grows, it
becomes impossible to run enough tests to ensure that there are
no errors.
This is true. More generally, it becomes impossible _by any practical
means_ to ensure that there are no errors. Unfortunately the
threshold size for this limit of practicality is very small.
Reliance solely on testing is OK for smallish systems. However, this
does not scale-up as the software becomes larger and more complex.
And I would say that "smallish" means "comp-sci 101 exercise". E.g.
Write a program to calculate the quadratic formula.
Further, one can test for the errors one expects. In software there are
likely to be a lot of errors no one could have anticipated. Those errors
are often overlooked by the tests.
Again, this is very true, and the incidence grows with the square of
the number of features. (if not faster).
There are many other things one must do as part of
the software process to arrive at a point where there is some
confidence in the final software product.
Agreed. You have to get your fingers and eyeballs on it. You have to
torture test it. You have to let a million monkeys into the room to
bang on it. You have to work hard to anticipate systematic weaknesses
and failures, and probe them all.
Each one of these things helps; and yet none are completely
sufficient. Spacecraft will still think they are on the ground when
they are 100Y up. They will still overshoot orbits because of unit
conversions. Billing systems will still send bills for negative
amounts. Telephone systems will still randomly drop you. And (though
it hasn't happened to my knowledge) airplanes will suddenly flip
upsidedown when they cross the horizon.
This is not to say we should not test. It simply means that we
should not be so naive as to put more faith in testing than is
realistically warranted.
Agreed. Nothing gets rid of all the risk. All we can do is mitigate
the risk. Testing is a *big* part of that, but is not the whole
enchilada.
It is also important to understand that more tests will not necessarily
make the code more maintainable. It might help a little, but more
important is the way we structure the code, organize the modules,
and design the architecture, among other things.
It is remarkable just how much the test-first discipline helps in this
regard. The act of designing your system around tests that you write
first goes a very long way towards helping to organize and structure
the code in a maintainable way.
Again, this is not a panacea. One should not depend on test-first as
the sole source of good design and structure. But it *does* help a
lot!
-----
Robert C. Martin (Uncle Bob) | email: (e-mail address removed)
Object Mentor Inc. | blog:
www.butunclebob.com
The Agile Transition Experts | web:
www.objectmentor.com
800-338-6716
"The aim of science is not to open the door to infinite wisdom,
but to set a limit to infinite error."
-- Bertolt Brecht, Life of Galileo