4 ms·
My kneejerk reaction is that this is BS but the text has good points and can function as an anecdote on how not to do things. "... Large functions for which 80
by fsloth 10y ago
My kneejerk reaction is that this is BS but the text has good points and can function as an anecdote on how not to do things.
"... Large functions for which 80% coverage was
impossible were broken down into many small functions for
which 80% coverage was trivial. This raised the overall
corporate measure of maturity of its teams in one year, because
you will certainly get what you reward. Of course, this also
meant that functions no longer encapsulated algorithms. It was
no longer possible to reason about the execution context of a
line of code in terms of the lines that precede and follow it in
execution,"
Unit tests which break code are stupid. Refactoring is good, but just splitting a large function into smaller pieces does nothing to improve the value of code unless it's done so that there is an understanding of the algorithm available and communicated.
Everything can be abused if not used craftly.