hcoles / pitest

State of the art mutation testing system for the JVM
Apache License 2.0
1.71k stars 357 forks source link

Feature Request: Exclude specific methods from mutation testing. #301

Open tjheslin1 opened 8 years ago

tjheslin1 commented 8 years ago

It would be smashing if I could specify a list of excluded methods that aren't global excludes.

@theangrydev and I have started on this by extending the <excludedMethod> tag to optionally allow specifying the class. For example:

<!-- example of the new syntax -->
<excludedMethod>io.package.SmashingClass#someMethod</excludedMethod>
<!-- example of preserving the old syntax -->
<excludedMethod>hashCode</excludedMethod>

My forked repo can be found here with the implementation can be found here: https://github.com/tjheslin1/pitest/commit/90a0b88d69e794467996c8498b0b34e33f82accb

We ran into some problems, we saw RUN_ERROR's which we found impossible to debug because we couldn't see the log output of the minions. We have started on a test in pitest-maven-verification which reproduces our problem.

Note: We plan to extend this further by adding an annotation (you can choose the name of this if you like).

@PITIgnore
public boolean isItTheMorning() {
   return true;
}
see-quick commented 3 weeks ago

Hi, I see this issue is really old. But looking at DOCs of the newest release I still can't see how to ignore specific methods from the analysis simply (i.e., <excludedMethod>io.package.SmashingClass#someMethod</excludedMethod>). Are there any plans to implement this? Thank you in advance for your quick answer @hcoles.