From: SourceForge.net <no...@so...> - 2010-06-02 15:03:49
|
Patches item #3010530, was opened at 2010-06-02 09:03 Message generated for change (Tracker Item Submitted) made by tcsmith You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=720017&aid=3010530&group_id=130558 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Tad E. Smith (tcsmith) Assigned to: Nobody/Anonymous (nobody) Summary: Ignore trivial methods & methods with "ignore" annotation Initial Comment: This is a patch to the 1.9.4.1 baseline. It adds 2 new switches: --ignoreTrivial and --ignoreMethodAnnotation. The --ignoreTrivial switch forces Cobertura to ignore the following in the coverage report. Getter methods that simply read a class field. Setter methods that set a class field. Constructors that only set class fields and call a super class constructor. The --ignoreMethodAnnotation is used to specify an annotation that, when present on a method, will force Cobertura to ignore the method in the coverage report. We also generate our getters and setters (as well as many constructors) using Eclipse. We don't want to spend time ensuring generated methods are covered by a JUnit test. (We trust the code generator otherwise we wouldn't use it.) On my project, we also use Eclipse to generate toString(), equals(), and hashCode() method. We put a "generated" annotation on these methods. Using these switches we are able to filter out the "noise" of generated methods in the coverage report and focus our attention on areas of the code that were written by developers. (Note: This is not a mechanism to boost coverage %, because in many cases the coverage % goes down when these methods are removed from the report.) Thanks, -- Tad ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=720017&aid=3010530&group_id=130558 |