How often should we write unit tests?

Posted by Midnight Blue on Stack Overflow See other posts from Stack Overflow or by Midnight Blue
Published on 2010-03-29T13:02:45Z Indexed on 2010/03/29 13:13 UTC
Read the original article Hit count: 237

Filed under:
|

Hi, I am recently introduced to the test-driven approach to development by my mentor at work, and he encourages me to write an unit-test whenenver "it makes sense." I understand some benefits of having a throughout unit-test suite for both regression testing and refractoring, but I do wonder how often and how throughout we should write unit-test.

My mentor/development lead asks me to write a new unit test-case for a newly written control flow in a method that is already being tested by the exsisting test class, and I think it is an overkill. How often do you write your unit tests, and how detailed do you think your unit tests should be? Thanks!

© Stack Overflow or respective owner

Related posts about java

Related posts about unit-test