5 ms·
"Obviously if you've walked the walk with unit-tests and done proper TDD and all that, you've caught the bugs before submitting your code." Unit testing and TD
by sheepmullet 11y ago
"Obviously if you've walked the walk with unit-tests and done proper TDD and all that, you've caught the bugs before submitting your code."
Unit testing and TDD are quite separate things. Perhaps you should try writing unit tests after you write your code and then you can come back and add value to the conversation.
- josteink 11y ago> Perhaps you should try writing unit tests after you write your code and then you can come back and add value to the conversation. Nice snark there. Feel free to keep it to yourself. To add actual value to the conversation (as opposed to your contribution), I can very much recommend the book "Working Effectively with Legacy Code"[1] for how to handle unit-testing in the scenario of existing "legacy" code-bases. It's full of useful tips and methods to get testing in place "anywhere" and has a pragmatical (as opposed religious) approach to getting it done. To spark some interest: The book defines "legacy code" as any code not covered by unit-tests. It may be seem dated (from 2004 and all), but it's been the most useful book I've read on unit-testing by far. [1] http://www.amazon.com/gp/product/0131177052/ref=as_li_tl?ie=UTF8&camp=1789&creative=390957&creativeASIN=0131177052&linkCode=as2&tag=jostekjoni-20&linkId=XZ6RUGMKOUPE4HTQ http://www.amazon.com/gp/product/0131177052/ref=as_li_tl?ie=...
- sheepmullet 11y agoYou came along and dismissed the parents views without any real thought. If you write the tests afterwards you can better gauge how well they catch bugs. It sounds like the parent has tried this and has found them pretty useless. I've personally found that unit tests are not worthwhile for many components, and yet are critical for others.
- GFischer 11y agoI've been meaning to buy that book for a long time, thanks for the refresher :) I've found that there are way more books for "greenfield" software development and not so many books for what 60% of people actually do (maintaining other people's projects, legacy or otherwise).