option to exclude setters/getters
Brought to you by:
vlad_r
A faster, 'hardcode-able' feature would be to detect setter and getters, and to not intrument them.
If a setter is strictly doing 1 assignment to the variable of the supposed name/type, or if the getter strictly return that supposed variable+type, then exclude.
This is particularly usefull when analysing coverage of tests.
Example of code to exclude:
void setFoo(<type> x) {
this.foo = x;
}
<type> getFoo() {
return this.foo;
}
Example of code to NOT exclude:
void setFoo(String x) {
if(x!=null) //because of condition
this.foo = x;
}
int getFoo() {
return foo<0? 0 : foo; //because of condition
}