pitest icon indicating copy to clipboard operation
pitest copied to clipboard

Mutator REMOVE_CONDITIONALS applies always when using the DEFAULTS group only

Open Red-CF opened this issue 8 months ago • 0 comments

I'm experiencing an unwanted/uncalled mutator with the following configuration:

Image

Using only the DEFAULTS group, adds the REMOVE_CONDITIONALS which by the docs isn't inside this group.

Searching through the code, I saw that in the class StandardMutatorGroups, it was added in the flavor of "REMOVE_CONDITIONALS_ORDER_ELSE" & "REMOVE_CONDITIONALS_EQUAL_ELSE":

`public class StandardMutatorGroups implements MutatorGroup { @Override public void register(Map<String, List<MethodMutatorFactory>> mutators) {

    mutators.put("DEFAULTS", gather(mutators,"INVERT_NEGS",
            "MATH",
            "VOID_METHOD_CALLS",
            "REMOVE_CONDITIONALS_ORDER_ELSE",
            "REMOVE_CONDITIONALS_EQUAL_ELSE",
            "CONDITIONALS_BOUNDARY",
            "INCREMENTS", "RETURNS"));

    mutators.put("STRONGER", gather(mutators,"DEFAULTS",
            "EXPERIMENTAL_SWITCH",
            "REMOVE_CONDITIONALS_ORDER_IF",
            "REMOVE_CONDITIONALS_EQUAL_IF"));

}

}`

My goal in opening the issue here, is to address why it's added and why there's no mention in the docs about it.

Thanks in advance :)

Red-CF avatar Mar 28 '25 10:03 Red-CF