O'Reilly logo
  • Russell Reed thinks this is interesting:

Speculative generality can be spotted when the only users of a function or class are test cases. If you find such an animal, delete the test case and apply Remove Dead Code (237).


Cover of Refactoring: Improving the Design of Existing Code


This is of course true if the function or class is being tested, but not if it is there in a support role in the test case, for testing something else.