4 ms·
>> I don't think I write faster, and I may not write more bug-free. But I sure feel better with TDD. False sense of achievement maybe ? You write more code, be
by smnplk 9y ago
>> I don't think I write faster, and I may not write more bug-free. But I sure feel better with TDD.
False sense of achievement maybe ? You write more code, because you also simultaneously write tests. But, have you ever noticed that, while your tests are great, your design sucks ? To me TDD is more a distraction than a tool for helping me think first before coding. I see tests only as a mandatory bureaucratic paperwork that needs to be done at the end of design process. Don't get me wrong, I think tests are a must, but only for ONE reason, to prevent software regressions. TDD for me is very pointless if not a dangerous practice.
- jressey 9y agoTDD is awful if you expect all of the tests you produced during the process to stay static. With care, you can pare down your test suite, or add additional tests, to be appropriate as a regression suite for the software each time it is iterated to a deliverable state. I actually find TDD helps me design components with fewer responsibilities, almost always as a result of realizing the complexity via writing permutations of test cases. It helps me think about 'what each thing should do' because I don't have that innate ability like some folks. It is especially helpful in pointing out cases where adding a layer of abstraction or introducing subclass variants are beneficial.
- beat 9y agoWhy is it a false sense of achievement? When I do TDD, I have demonstrably working code. What doesn't give me a sense of achievement is writing a ton of code with no evidence that it works or is bug-free. Heck, even before coding, I like using Cucumber as a form to think about code behavior and responsibilities. I don't really enjoy fully automated Cucumber in practice, but the format is terrific. If all you see tests for is "mandatory bureaucratic paperwork", maybe you should be concerned about overconfidence in your ability to do flawless design and implementation. Writing tests is one of the best tools I've found for making sure I actually understand what it is I'm trying to do (and if what I'm trying to do is actually wrong).
- smnplk 9y agoSorry for late reply. >> If all you see tests for is "mandatory bureaucratic paperwork", maybe you should be concerned about overconfidence in your ability to do flawless design and implementation. I don't buy into the idea that TDD or any kind of testing methodollogy gives you confidence to do good design or in any way helps you make good design decisions. >> When I do TDD, I have demonstrably working code. What doesn't give me a sense of achievement is writing a ton of code with no evidence that it works or is bug-free False sense of program correctness right there ;) Are you telling me that by doing example based testing, you are 100% bug free ? Your tests must be humongous. >> Writing tests is one of the best tools I've found for making sure I actually understand what it is I'm trying to do (and if what I'm trying to do is actually wrong). Pen and paper for some and more code for others.