6 ms·
I'm not an expert on TDD, but how does TDD help in this situation? If your requirements change, your existing tests and code become (partly) useless. This woul
by dtech 9y ago
I'm not an expert on TDD, but how does TDD help in this situation?
If your requirements change, your existing tests and code become (partly) useless. This would indicate the most efficient way is the exact opposite where you test minimally until the requirements have stabilized.
- lgunsch 9y agoThe goal of TDD is not to have tests, or a huge test coverage. Those are just important side-effects. One goal, ignoring how it improves focus and divides complexity up nicely, is to make cleaner code. If your code respects the single-responsibility-principle, is not duplicated, and doesn't have dependency issues, you can adjust the requirements faster. The test suite allows you to be confident your changes to some parts of the system don't break others. You can keep more code, not even having to touch many parts of the system. You know that by changing x, you don't also have to change w, y and z. Of course code still must change, but its vastly simpler and quicker to change. Now, that doesn't mean you can't have those benefits without TDD, it's just much easier and clear.
- lgunsch 9y agoTDD allows you to make your abstractions based on real evidence, rather than conjecture.