Issue #13095: kill mutation for VariableDeclarationUsageDistanceCheck 3#13099
Issue #13095: kill mutation for VariableDeclarationUsageDistanceCheck 3#13099rdiachenko merged 1 commit intocheckstyle:masterfrom
Conversation
|
I don't find any test case which can kill this mutation. https://github.com/Kevin222004/checkstyle/blob/d60bae5293a4221f4e5b28da1300441a90be5d44/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/VariableDeclarationUsageDistanceCheck.java#L569-L571 In default case |
...ava/com/puppycrawl/tools/checkstyle/checks/coding/VariableDeclarationUsageDistanceCheck.java
Outdated
Show resolved
Hide resolved
romani
left a comment
There was a problem hiding this comment.
ok to merge.
I think we need to extend even more project set for cases that we can not find code to cover and ready to apply pitest suggestion.
It will be not CI execution, but we can ask @Kevin222004 , to add 20 more HUGE java projects and let hit execute on his local validation and double confirm that nothing is found.
@Kevin222004 , if you agree please do this while we waiting for other mentors to review this PR.
|
@Kevin222004 , conflict again . |
@Kevin222004 do not forget about option to fork repo at https://github.com/nrmancuso/nrmancuso.github.io to generate and host lots of reports easily. |
|
We probably need to invest more in tool like this, as we will need even during regular feature development, chasing a regression will be always required. |
|
Thanks @nrmancuso I have this in my mind and will do it. |
|
Regression :- https://kevin222004.github.io/Regression/ @romani please look at this report I have chosen some of the projects. |
|
I am ok. |
|
@Kevin222004 It is better to create an extended list and keep it on a gist or something. You can add these projects too: Please attach a regression report with these projects too. |
|
@Kevin222004 Let's follow some pattern for the PR description.
This would make it easier to evaluate PRs throughout the project and easier to refer to them in the future. |
|
@Kevin222004 All the configurations in the diff report don't use Please follow the pattern above and generate reports with |
|
@Vyom-Yadav , as you finish review reassign it to next reviewer, you should have permission to do this now |
Regression :- https://kevin222004.github.io/reports/M3/2023-05-31-T-09-24-56/test-report/index.html |
|
@rdiachenko ping |
1 Issue #13095: kill mutation for VariableDeclarationUsageDistanceCheck 3
2 Link to Check Documentation :-
https://checkstyle.org/config_coding.html#VariableDeclarationUsageDistance
3 covering
checkstyle/config/pitest-suppressions/pitest-coding-1-suppressions.xml
Lines 129 to 136 in 6f451fb
4 Logic behind mutation removal
I don't find any test case which can kill this mutation.
https://github.com/Kevin222004/checkstyle/blob/d60bae5293a4221f4e5b28da1300441a90be5d44/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/VariableDeclarationUsageDistanceCheck.java#L569-L571
whenever the token type is off
TokenTypes.VARIABLE_DEFthenresultDist++;will increment by 1.In default case
https://github.com/Kevin222004/checkstyle/blob/d60bae5293a4221f4e5b28da1300441a90be5d44/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/VariableDeclarationUsageDistanceCheck.java#L589-L595
if (examineNode.findFirstToken(TokenTypes.SLIST) == null) {here if theifstatment is been executing then similarlyresultDist++;will increment by 1 their is no case possible whereSLISTbecome the child ofVARIABLE_DEFso it is always going to be null and every time only if will execute.5 Reports :-
https://kevin222004.github.io/reports/M3/2023-05-31-T-09-24-56/test-report/index.html