2 ms·
I don't do 100% TDD, but do write code to be testable, and a lot of that mindset and experience came from trying TDD. Forcing myself to think "how would this b
by mgkimsal 10y ago
I don't do 100% TDD, but do write code to be testable, and a lot of that mindset and experience came from trying TDD.
Forcing myself to think "how would this be tested?" helped, but doing some of the tests first got me in that frame of mind.
And by practicing that, you're writing code that - by definition - is reusable - you're using it in the tests, and in your production code. The 'reuse' thing doesn't have to mean 'reuse on 8 other projects' (a common rebuttal I've heard). Reusing the functionality in another part of your project 3 months from now is reuse too.