4 ms·
They will save you time in the long run, because they automate your testing. If you spend some time writing a unit test to cover some code, you never have to w
by j_col 15y ago
They will save you time in the long run, because they automate your testing. If you spend some time writing a unit test to cover some code, you never have to worry about testing that piece of code again: it will be automatically tested every time you run your test suite.
I also agree that they can be hard to write, however this will make you a better programmer as it forces you to really think about the code you're testing (for example if it can't be tested in an isolated fashion by a unit test, then it may not be modular enough).