4 ms·
> The trouble with TDD is that quite often we don't really know how our programs are going to work Interesting - for me, that's the only time I truly practice
by silversmith 4y ago
> The trouble with TDD is that quite often we don't really know how our programs are going to work
Interesting - for me, that's the only time I truly practice TDD, when I don't know how the code is going to work. It allows me to start with describing the ideal use case - call the API / function I would like to have, describe the response I would expect. Then work on making those expectations a reality. Add more examples. When I run into a non-trivial function deeper down, repeat - write the ideal interface to call, describe the expected response, make it happen.
For me, TDD is the software definition process itself. And if you start with the ideal interface, chances are you will end up with something above average, instead of whatever happened to fall in place while arranging code blocks.