4 ms·
One of the other drawbacks besides performance that I have seen in terms of "making code testable" is that it often hurts traceability. If I am jumping into an
by skohan 6y ago
One of the other drawbacks besides performance that I have seen in terms of "making code testable" is that it often hurts traceability. If I am jumping into an unfamiliar codebase, the best case is that I can right click on any method invocation, "go to declaration" and see what code is being executed. Often times in codebases which make heavy use of dependency injection, "go to declaration" takes me instead to some kind of interface declaration, and then I have to figure out which code is actually being executed at runtime.
I feel like this is a very real cost, and is often not accounted for in terms of the tradeoffs discussed in TDD.
- tsimionescu 6y agoI don't think this is a major problem with interfaces that have a real implementation and a mock implementation. You can just as well "Go to implementation", and will see two options - XImpl and MockXImpl.