Skip to content

Commit

Permalink
t/README: Add a note about the dangers of coverage chasing
Browse files Browse the repository at this point in the history
Having no coverage at all is almost always a bad sign, but trying to
attain 100% coverage everywhere is usually a waste of time. Add a
paragraph to explain this to future test writers.

Inspired-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Ævar Arnfjörð Bjarmason authored and Junio C Hamano committed Aug 18, 2010
1 parent 0c35754 commit e8b55f5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions t/README
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,15 @@ Do:
- Check the test coverage for your tests. See the "Test coverage"
below.

Don't blindly follow test coverage metrics, they're a good way to
spot if you've missed something. If a new function you added
doesn't have any coverage you're probably doing something wrong,
but having 100% coverage doesn't necessarily mean that you tested
everything.

Tests that are likely to smoke out future regressions are better
than tests that just inflate the coverage metrics.

Don't:

- exit() within a <script> part.
Expand Down

0 comments on commit e8b55f5

Please sign in to comment.