Skip to content

Issue #13328: Kill mutation ImportOrder#13333

Merged
rdiachenko merged 1 commit intocheckstyle:masterfrom
Kevin222004:BeginTree2
Jul 10, 2023
Merged

Issue #13328: Kill mutation ImportOrder#13333
rdiachenko merged 1 commit intocheckstyle:masterfrom
Kevin222004:BeginTree2

Conversation

@Kevin222004
Copy link
Copy Markdown
Contributor

@Kevin222004 Kevin222004 commented Jul 2, 2023

Issue #13328: Kill mutation ImportOrder


Check

https://checkstyle.org/checks/imports/importorder.html#ImportOrder


Mutation

<mutation unstable="false">
<sourceFile>ImportOrderCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.imports.ImportOrderCheck</mutatedClass>
<mutatedMethod>beginTree</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.MemberVariableMutator</mutator>
<description>Removed assignment to member variable lastImport</description>
<lineContent>lastImport = &quot;&quot;;</lineContent>
</mutation>


Explaination

Almost similar to #13334

else if (groupIdx == lastGroup) {
doVisitTokenInSameGroup(isStatic, previous, name, ast);
}
this never will be equal so conditon will never execute

so no test cases looks possible to clear the state using input


Regression

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/f0f6fb2_2023072736/reports/diff/index.html

https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/f0f6fb2_2023084409/reports/diff/index.html

Diff Regression config: https://gist.githubusercontent.com/Kevin222004/e3a00111b4bb7b8c054483466b88606d/raw/4895c88b1daf686479058c972bad0c27cd0818ef/IOC.xml
Diff Regression projects: https://gist.githubusercontent.com/Kevin222004/9600f179b602d4c971bdb0a050099005/raw/360a95ed7bb60d7a0956e531199d484c4d6f6617/test-projects.properties
Report label: new-Regression-1

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 2, 2023

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 2, 2023

Copy link
Copy Markdown
Member

@Vyom-Yadav Vyom-Yadav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Both this PR and #13334 had acceptable logic.

@Kevin222004 If there are more mutations in beginTree, make sure you include these changes too while generating reports.

@Vyom-Yadav Vyom-Yadav assigned rdiachenko and unassigned Vyom-Yadav Jul 8, 2023
@romani
Copy link
Copy Markdown
Member

romani commented Jul 8, 2023

I agree.

lastGroup covers field it

Copy link
Copy Markdown
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok to merge

Copy link
Copy Markdown
Member

@rdiachenko rdiachenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rdiachenko rdiachenko merged commit 3a61293 into checkstyle:master Jul 10, 2023
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

Successfully merging this pull request may close these issues.

4 participants