Can you give any examples of real code that become less clear after it was rewritten for testability, and explain why it is worse after the rewrite?
On Tue, Jun 4, 2013 at 7:20 PM, Marc A. Pelletier marc@uberbox.org wrote:
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
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l