Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When should you stop unit testing

Tags:

unit-testing

I can often identify plenty of areas which are nicely encapsulated and easily unit tested, but I also find that a lot of code where unit testing doesn't really seem to work as well - typically data access and user interface. No matter what unit testing "techniques" I try I tend to find that in these places it's not only a lot of effort to create functioning unit tests, but these tests tend to be very fragile and don't really test very much.

At what point do you stop and decide that the benefits of unit testing isn't worth the cost?

like image 960
Justin Avatar asked Jul 16 '09 07:07

Justin


People also ask

How long should unit tests run?

Still, it seems as though a 10 second short-term attention span is more or less hard-wired into the human brain. Thus, a unit test suite used for TDD should run in less than 10 seconds. If it's slower, you'll be less productive because you'll constantly lose focus.

When should the unit testing be performed?

Unit Testing of the software product is carried out during the development of an application. An individual component may be either an individual function or a procedure. Unit Testing is typically performed by the developer. In SDLC or V Model, Unit testing is the first level of testing done before integration testing.

How often should unit tests be executed?

Goal number two is to execute unit tests each time developers check in code and every time the team creates a new build. When developers use unit tests to prevent breaking changes in a branch, they can prevent rework and project delays.


1 Answers

When you can provide better value by doing something else.

like image 91
tomjen Avatar answered Jan 03 '23 06:01

tomjen