4 ms·
The main benefit of TDD: It strongly encourages you to think of your code as several input/output problems. When you apply this model of thinking at scale it
by namuol 9y ago
The main benefit of TDD:
It strongly encourages you to think of your code as several input/output problems.
When you apply this model of thinking at scale it tends to lead to a much simpler (read: less-complex) codebase.
- sowbug 9y agoThis is the top-level comment that resonated most with the point I wanted to make. TDD is good for training you to recognize untestable code. "Oh, yeah, that's a Law of Demeter thing... maybe we should just ask for the narrow object rather than the giant one that knows how to get the narrow one," etc. Once you have that skill ingrained, it's reasonable to stray from strict TDD and simply remember to defend your code with adequate tests.