#122 Filter methods from the coverage report

open
nobody
None
5
2010-02-09
2010-02-09
Anonymous
No

Hi all,
I think that would be interesting to have the ability to filter methods from the coverage report. There are methods that aren't important (for a lack of a better adjective) enough to be tested. For example, if I override a toString() method for debug purposes, or dummy get/set methods. The problem is that the coverage report is polluted from non-tested code that from a developer point of view shouldn't be tested (well, just simply not interested in test it).
Thanks

Discussion

  • Richard Eggert
    Richard Eggert
    2013-01-27

    It would also be helpful to tag individual lines as ignored (either by using an annotation or some token placed into a comment) in order to avoid counting things like sanity checks and parameter validation that will execute only if there is a bug elsewhere in the code. For example, if a method checks that its arguments are valid and throws an IllegalArgumentException (or, in the case of null arguments, NullPointerException), it shouldn't be necessary to test the method by passing it an invalid argument just to get the coverage report to stop complaining.