Re:Should I write unit tests? Yes and I’ll tell you why.
by krapp on Wednesday February 19, 2014 @03:07PM
(#7265864)
If I have projects which were written without tests because I was an idiot and didn't know "running it and seeing that it works" counted as a test, should I go back and write tests for what I already have or start testing on new code only?
[ Parent
| on HN ]
Re:Should I write unit tests? Yes and I’ll tell you why.
by jaredbrown on Wednesday February 19, 2014 @06:39PM
(#7267485)
I recommend the following strategy:
1. Don’t ship any new features without writing unit tests for them first.
2. These new features most likely rely on parts of existing code so write a few tests for that existing code with each new feature.
3. If something breaks in production write a test for it at the time that you fix it.
Little by little you’ll increase your code coverage without grinding development to a halt.