Code coverage and tests often go hand-in-hand. How do you know you're testing enough, or even if you're testing certain things too much? You can use code coverage tools to see the level to which code is tested. By running tests through a code coverage tool you can see what code was executed and what code wasn't executed by tests. To a certain extent, you can use certain static analysis tools to see what classes and methods would be executed by tests. However, code coverage tools show you what parts of those classes and methods were executed.
Context: When automating builds with techniques such as nightly builds.
Practice: Monitor code coverage percentage deltas to see if coverage is increasing or decreasing, rather than specific percentages.
Code coverage generally gives you a percentage metric that tells you what percentage of code is covered by tests. Having code coverage monitor during automated tests can lead to obsession about code coverage. Knee-jerk policies such as...