I worked at a company where unit tests ran as part of the build. The build failed if the unit tests failed. What are the benefits and disadvantages of that practice?
|
|
We run unit tests prior to check-in and rerun them as part of a larger test suite on each daily build (feature branch) and weekly build (main branch; multiple feature branches aggregated). Some advantages we have found include:
Some potential cautions
|
|||||||
|
|
For the sake of discussion... there are some real disadvantages for unit tests when done properly-
|
|||||
|
|
Unit tests should always be run as a part of build. We have been doing that for over 2 years in our project and the benefits have always outweighed the disadvantages. Not only these are run with the build but we have checks in place which breaks the build when the coverage falls below a certain threshold (although I agree with Bj above on code covergae != good testing). Some of the benefits we see :
Some things to take care for:
|
||||
|
|
|
In a Team comprised of multiple developers.
Below are advantages of running unit test cases before build is provided to QA Team
|
|||||||||||
|