Should I write unit tests? Yes and I’ll tell you why.
blog.hubstaff.com
Should I write unit tests? Yes and I’ll tell you why.
1–10 of 11 posts
Re: Should I write unit tests? Yes and I’ll tell you why.
#2Re: Should I write unit tests? Yes and I’ll tell you why.
#3Possible counter point: while the unit-tester is busy writing perfect software. I'll be lazy... and perhaps I'll beat them to market and will use the resulting money to perfect the software.
I actually thought the same way you do until just recently. Once you get into the flow of writing unit tests, you'd be surprised how little time it takes, and how effective TDD can be. It helps me stay focused, and structure programs better. I can't say if it actually has slowed my development time at all, when you take into account fixing bugs found in functional testing.
Re: Should I write unit tests? Yes and I’ll tell you why.
#4Possible counter point: while the unit-tester is busy writing perfect software. I'll be lazy... and perhaps I'll beat them to market and will use the resulting money to perfect the software.
Re: Should I write unit tests? Yes and I’ll tell you why.
#5Re: Should I write unit tests? Yes and I’ll tell you why.
#6"Do you think the customer is going to get angry if you explain that part of your development process is to execute the code you just wrote to make sure it doesn’t crash? If the answer to that is “no, of course not, that’s ridiculous” then you also have the answer to whether or not a customer would care if you happened to automate that process."
Re: Should I write unit tests? Yes and I’ll tell you why.
#7Re: Should I write unit tests? Yes and I’ll tell you why.
#8Re: Should I write unit tests? Yes and I’ll tell you why.
#9If 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?
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.
Re: Should I write unit tests? Yes and I’ll tell you why.
#10My favourite argument for unit testing comes from http://www.daedtech.com/intro-to-unit-testing-10-the-busines... : "Do you think the customer is going to get angry if you explain that part of your development process is to execute the code you just wrote to make sure it doesn’t crash? If the answer to that is “no, of course not, that’s ridiculous” then you also have the answer to whether or not a customer would care…