Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for excluding mutators #954

Closed
npathai opened this issue Oct 30, 2021 · 2 comments
Closed

Support for excluding mutators #954

npathai opened this issue Oct 30, 2021 · 2 comments

Comments

@npathai
Copy link

npathai commented Oct 30, 2021

Carrying over this feature request from https://github.com/szpak/gradle-pitest-plugin

Issue:
Support for excluding mutators

Feature Request:
Ability to specify the mutators like this:

pitest {
    // …
    mutators = ['All'] - ['UOI']
    // …
}

or, if that is not possible, with something equivalent, like this:

pitest {
    // …
    mutators = ['All']
    excludeMutators = ['UOI']
    // …
}

Use case: instead of having a long list of all mutators to run, be able to specify a large set of mutators, like 'ALL', and then just exclude some from the list, like ['UOI'], when they produce too many false positives.

I had gone through the source code of PIT and found that there is no way to exclude specific mutators.

@hcoles
Copy link
Owner

hcoles commented Nov 1, 2021

Hi @npathai,

I think something like this would be useful. The easiest syntax to implement would be

mutators = ['ALL', '-UOI', '-CONDITIONAL_BOUNDARY']

This would work without updating any of the tooling.

That said, unless you are doing research, enabling ALL mutators and then disabling one or two of them is not a good idea. Most of the mutators in the 'RV' research set are not usable for day to day development. I will likely move them out of the main codebase now that pitest supports pluggable mutators.

hcoles pushed a commit that referenced this issue Nov 1, 2021
hcoles pushed a commit that referenced this issue Nov 1, 2021
hcoles added a commit that referenced this issue Nov 1, 2021
@hcoles
Copy link
Owner

hcoles commented Nov 9, 2021

Released in 1.7.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants