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

Pitest: add new mutator REMOVE_CONDITIONALS #6320

Closed
rnveach opened this issue Dec 27, 2018 · 16 comments
Closed

Pitest: add new mutator REMOVE_CONDITIONALS #6320

rnveach opened this issue Dec 27, 2018 · 16 comments
Labels
approved has bounty issue has some money incentive to fix it, https://www.bountysource.com/teams/checkstyle/issues miscellaneous
Milestone

Comments

@rnveach
Copy link
Member

rnveach commented Dec 27, 2018

This is not an unstable mutator, just disabled by default.

http://pitest.org/quickstart/mutators/#REMOVE_CONDITIONALS

The remove conditionals mutator will remove all conditionals statements such that the guarded statements always execute
Although not currently enabled by default it is highly recommended that you enable it if you wish to ensure your test suite has full coverage of conditional statements.

Please note:

The reason these are not enabled by default is that there is a large degree of overlap in the tests required to kill these mutations and those required to kill mutations from other default operators such as the conditional boundaries mutator.

Report with only new mutator added, and others disabled: http://rveach.no-ip.org/checkstyle/regression/pitest-reports/30/

This mutator increased the number of timeouts by 6x. And increased the number of memory errors by 93.

Every profile requires 10-15 percent of mutations to be killed, so adding this mutator will take some work. It might be recommended to work by profile instead of doing the entire mutator at once.


rnveach added a commit to rnveach/checkstyle that referenced this issue Dec 28, 2018
rnveach added a commit to rnveach/checkstyle that referenced this issue Dec 28, 2018
rnveach added a commit to rnveach/checkstyle that referenced this issue Dec 28, 2018
rnveach added a commit to rnveach/checkstyle that referenced this issue Dec 28, 2018
rnveach added a commit to rnveach/checkstyle that referenced this issue Dec 29, 2018
rnveach added a commit to rnveach/checkstyle that referenced this issue Dec 30, 2018
rnveach added a commit to rnveach/checkstyle that referenced this issue Dec 30, 2018
rnveach added a commit to rnveach/checkstyle that referenced this issue Dec 30, 2018
rnveach added a commit to rnveach/checkstyle that referenced this issue Dec 30, 2018
rnveach added a commit to rnveach/checkstyle that referenced this issue Jan 18, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Jan 20, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Jan 20, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Jan 20, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Jan 20, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Jan 20, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Jan 20, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Jan 20, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Jan 20, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Jan 20, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Jan 21, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Jan 22, 2022
Vyom-Yadav added a commit to Vyom-Yadav/checkstyle that referenced this issue Jan 29, 2022
romani pushed a commit that referenced this issue Jan 29, 2022
MUzairS15 pushed a commit to MUzairS15/checkstyle that referenced this issue Jan 30, 2022
rnveach added a commit to rnveach/checkstyle that referenced this issue Feb 19, 2022
rnveach added a commit to rnveach/checkstyle that referenced this issue Feb 20, 2022
@pbludov
Copy link
Member

pbludov commented Feb 25, 2022

@rnveach should this issue be closed? Will there be more PR?

@rnveach
Copy link
Member Author

rnveach commented Feb 25, 2022

Mutator is not completely finished until suppression list is resolved.
3ef61de#diff-4e0a49a8be36cb3b594f01212755dcf16d2f4fc701ded58ee7404f7180ed958fR148

If it won't be done as part of this issue, then we need a new issue to cover it.

@romani romani added this to the 10.0 milestone Feb 26, 2022
@Vyom-Yadav
Copy link
Member

All the mutations in 3ef61de#diff-4e0a49a8be36cb3b594f01212755dcf16d2f4fc701ded58ee7404f7180ed958fR148 have been addressed, mutator has also been added to each profile (PRs open). PRs for resolving the suppression list have been linked to #11720 and PRs for adding the mutator have been linked to #11719

@nrmancuso
Copy link
Member

All the mutations in 3ef61de#diff-4e0a49a8be36cb3b594f01212755dcf16d2f4fc701ded58ee7404f7180ed958fR148 have been addressed, mutator has also been added to each profile (PRs open).

Please show proof via CLI output on latest master (use git log -1) that this has been addressed so that we can close issue.

@Vyom-Yadav
Copy link
Member

@nick-mancuso

$ git log --oneline --grep="Issue #11719: Activate all group for" -i
db0523580 Issue #11719: Activate all group for pitest-coding-require-this-check
413f8f012 Issue #11719: Activate all group for pitest-common
2f8f8c001 Issue #11719: Activate all group for pitest-regexp
ed4ef44d0 Issue #11719: Activate all group for pitest-sizes
69883304f Issue #11719: Activate all group for pitest-common-2
ee6180c6e Issue #11719: Activate all group for pitest-packagenamesloader
45a57449f Issue #11719: Activate all group for pitest-api
9c6ce2a66 Issue #11719: Activate ALL group for pitest-coding-1
000cfefe9 Issue #11719: Activate ALL group for pitest-ant
35894042f Issue #11719: Activate all group for pitest-tree-walker
f36a674f6 Issue #11719: Activate all group for pitest-modifier
36c8ce2cc Issue #11719: Activate all group for pitest-naming
e23c84be8 Issue #11719: Activate all group for pitest-utils
55f2e6dd9 Issue #11719: Activate all group for pitest-whitespace
ad5486a39 Issue #11719: Activate all group for pitest-main
caa4b9836 Issue #11719: Activate all group for pitest-xpath
03453162d Issue #11719: Activate all group for pitest-metrics
cc8256847 Issue #11719: Activate all group for pitest-coding-2
24aedada5 Issue #11719: Activate all group for pitest-imports
bed1d9f73 Issue #11719: Activate all group for pitest-annotation
885748a84 Issue #11719: Activate all group for pitest-design
7e52224b4 Issue #11719: Activate all group for pitest-filters
41bef768f Issue #11719: Activate all group for pitest-header
f7de89707 Issue #11719: Activate all group for pitest-misc
b7ca83e7f Issue #11719: Activate all group for pitest-blocks
866ae866b Issue #11719: Activate all group for pitest-java-ast-visitor
9ef1ad6ef Issue #11719: Activate ALL group for pitest-javadoc
$ git log --oneline --grep="minor: Modify pitest" -i                
1c03f44fd minor: Modify pitest mutators for pitest-javadoc
307ae4b29 minor: Modify pitest mutators for pitest-java-ast-visitor

@Vyom-Yadav
Copy link
Member

└─$ ag --stats -Q "REMOVE_CONDITIONALS" --ignore "src/xdocs/releasenotes.xml"
pom.xml
2341:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
2342:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
2343:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
2344:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
2449:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
2450:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
2451:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
2452:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
2510:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
2511:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
2512:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
2513:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
2571:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
2572:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
2573:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
2574:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
2677:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
2678:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
2679:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
2680:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
2796:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
2797:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
2798:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
2799:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
2857:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
2858:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
2859:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
2860:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
2918:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
2919:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
2920:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
2921:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
2979:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
2980:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
2981:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
2982:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
3039:                <!-- <mutator>REMOVE_CONDITIONALS</mutator> -->
3085:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
3086:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
3087:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
3088:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
3157:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
3158:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
3159:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
3160:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
3218:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
3219:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
3220:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
3221:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
3279:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
3280:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
3281:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
3282:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
3340:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
3341:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
3342:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
3343:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
3401:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
3402:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
3403:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
3404:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
3462:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
3463:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
3464:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
3465:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
3524:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
3525:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
3526:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
3527:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
3585:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
3586:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
3587:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
3588:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
3643:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
3644:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
3645:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
3646:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
3745:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
3746:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
3747:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
3748:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
3824:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
3825:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
3826:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
3827:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
3882:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
3883:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
3884:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
3885:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
3992:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
3993:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
3994:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
3995:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
4073:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
4074:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
4075:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
4076:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
4136:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
4137:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
4138:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
4139:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
4259:                <mutator>REMOVE_CONDITIONALS</mutator>
4331:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
4332:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
4333:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
4334:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
4396:                <mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
4397:                <mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>
4398:                <mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
4399:                <mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>
110 matches
1 files contained matches
4616 files searched
25854258 bytes searched
0.038401 seconds

110 matches, every profile contains

<mutator>REMOVE_CONDITIONALS_EQUAL_ELSE</mutator>
<mutator>REMOVE_CONDITIONALS_EQUAL_IF</mutator>  
<mutator>REMOVE_CONDITIONALS_ORDER_ELSE</mutator>
<mutator>REMOVE_CONDITIONALS_ORDER_IF</mutator>  

27 profiles addressed (excluding gui and indentation).
110 = 27 * 4 + 1 (Commented out in indentation profile) + 1 (gui profile)

@romani
Copy link
Member

romani commented Oct 8, 2022

confirmed, all activated except for gui and indentation - it is expected.
gui do not need this level of testing.
indentation need major rewrite.

@romani romani closed this as completed Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved has bounty issue has some money incentive to fix it, https://www.bountysource.com/teams/checkstyle/issues miscellaneous
Projects
No open projects
Status: Done
Development

No branches or pull requests

6 participants