3 ms·
But, given the changing and newly-discovered requirements, letting tests drive the design of the implementing code can still be surprisingly effective. Why? B
by AnimalMuppet 5y ago
But, given the changing and newly-discovered requirements, letting tests drive the design of the implementing code can still be surprisingly effective.
Why? Because if I find it hard to write the test, it's telling me that I'm likely to find it hard to write non-test code that uses the class/module/subsystem/whatever. It forces you to use the interface to your code. If it's hard to use, that's telling you to consider changing the design.
- sidlls 5y agoThis assumes the test isn’t making it hard to use unnecessarily.