On 06/04/2013 12:57 PM, Nikolas Everett wrote:
The thing is quite a few of us have seen cases where
people bend over
backwards for test coverage, sacrificing code quality and writing tests
that don't provide any real value.
Probably better expressed than I did.
My point is: clearly test coverage doesn't /produce/ bad code -- but
writing *for* test coverage does. Or at least, I've observed a strong
correlation between mandated test coverage metrics and code with
atrocious factorization and poor conceptual coherency.
Tests are good. Unit testing has valuable uses in a number of cases.
Trying to universally shoehorn either into the development process is
rarely useful, and often disastrous.
(Often, for instance, coherency of the code is sacrificed atop the altar
of separation of concerns for a vacuous gain in "testability" at the
expense of clarity).
-- Marc