3 ms·
> TDD makes it painful to write tightly coupled code, and that's the point. That's also the problem with TDD. Another word for "tightly coupled code" is "cohes
by discreteevent 3y ago
> TDD makes it painful to write tightly coupled code, and that's the point.
That's also the problem with TDD. Another word for "tightly coupled code" is "cohesive code". There's a tradeoff between coupling and cohesion. The problem with TDD is that it can make people decouple cohesive code just to make it testable. I have seen this many times where the only use of some abstraction/indirection was the test. These abstractions/decouplings then mount up to make the codebase much more difficult to understand and maintain than a simple cohesive codebase (with decouplings only where necessary).