Including test files in coverage reportsby Rob Galanakis on 9/08/2012
We’ve finally gotten our test coverage reports published to an accessible place and I’ve been wondering whether including test files as part of the coverage report is generally preferable to excluding them.
Initially I thought they should be excluded- after all, it’s your ‘real’ code people are generally worried about- but now I’m not so sure. You should probably make sure your test files are actually run and covered, as once you have a large amount of tests that often bend in various ways, it isn’t always a given. And actually that’s just the case we were in today, we have tests that are still not runnable on our CI server, but the report doesn’t show which ones.
Not to mention having your test source easily browseable in the form of a coverage report, which is easier for test-curious people to browse than a source depot.
I think I’m going to re-include tests in the report, despite it skewing our coverage percentage (favorably :)). But I’m really curious if there’s accepted practice or good reasons either way I haven’t thought firstname.lastname@example.org