3 ms·
For me the greatest benefit of TDD is that I can first specify how a unit of code is expected (by me the implementer) to behave. Then I write the code that ful
by eaurouge 14y ago
For me the greatest benefit of TDD is that I can first specify how a unit of code is expected (by me the implementer) to behave. Then I write the code that fulfills (just) those specs, without writing any unnecessary lines of code. If you've read the specs then you know how the code behaves. Yes, you can write the code first then the tests, and I do and have done that. But there's something to be said for letting the specifications alone determine what makes it into code. Of course, you need to know the specifications for this to work, which isn't always the case.