Re:The paradigms of programming
by tigershark on Monday January 29, 2018 @01:58PM
(#16259743)
If you need to “over-parametrise” to make a class testable the problem is not in the unit test, it’s in your design.
[ Parent
| on HN ]
Exactly the kind of over-engineering I'm talking about.
The objective is to solve business problems, not write tests. Warping design to introduce unnecessary abstractions and indirections for testing is what leads to Java-itis, with factory factories.
Re:The paradigms of programming
by crdoconnor on Tuesday January 30, 2018 @07:06AM
(#16264616)
This is exactly why I only ever test at the edges of a project, using mock systems that are as realistic as possible given time and resource constraints. The industry has an unhealthy obsession with ultrafast, ultra-unrealistic, low level unit tests that tightly couple to implementation details rather than behavior.
I don't think this is over-engineering though. Even if unit tests didn't warp designs they'd be a bad idea. I think it's just bad engineering based upon stupid dogma spread by the likes of J.D. Rainsberger and Uncle Bob.