Thread (17 messages) flat view 17 messages, 2 authors, 2016-06-15
DORMANTno replies

Revision v2 of 2 in this series.

Revisions (2)
  1. v2 current
  2. v3 [diff vs current]

[PATCH v2 7/7] t/README: Add a note about the dangers of coverage chasing

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:49:11
Subsystem: the rest · Maintainer: Linus Torvalds

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 [off-list ref]
Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 t/README |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/t/README b/t/README
index 2fa6744..400e2da 100644
--- a/t/README
+++ b/t/README
@@ -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.
-- 
1.7.0.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help