3 ms·
Wittgenstein isn't the only one who owns a ladder, and there are many boats and even bridges one can use to cross a river. Some rivers you can even wade or swim
by dalke 17y ago
Wittgenstein isn't the only one who owns a ladder, and there are many boats and even bridges one can use to cross a river. Some rivers you can even wade or swim across. Testing is not a treacherous expanse of water crossed solely by own's own efforts. But that's just a quippy response.
More seriously, TDD doesn't really have nudge #2. I showed examples where TDD-based solutions weren't thought through well enough to be declared done, and I showed that in the prime factor case that the tests aren't sufficient to be good tests for the implemented algorithm. Specifically, tests should help others verify that the code works (which is not a goal of TDD), and the lack of tests with prime factors greater than 3 is a warning flag that should have been addressed during the development iterations. That the code happens to works (for sufficiently small numbers) is not the issue - the issue is that the tests aren't good enough to remove reasonable doubt.
- michael_dorfman 17y agoI absolutely agree that TDD does not guarantee well-thought-out code. (If you find something that does, let me know.) However, for some people, I do think it does give them a nudge in the right direction. Over the years, I've been amazed at the quantity of code I've seen written by programmers who had only the vaguest notion of what the code they were writing was supposed to do. Any ritual, no matter how silly, that helps the novice (or lazy) coder to stop and think before coding is ok by me. But, as I said, there's a long way from that to insisting on TDD as "the one true way".