Skip to content

Issue #13109: Kill mutation for OneStatementPerLineCheck-2#13193

Merged
romani merged 1 commit intocheckstyle:masterfrom
Kevin222004:oneStat
Jun 24, 2023
Merged

Issue #13109: Kill mutation for OneStatementPerLineCheck-2#13193
romani merged 1 commit intocheckstyle:masterfrom
Kevin222004:oneStat

Conversation

@Kevin222004
Copy link
Copy Markdown
Contributor

@Kevin222004 Kevin222004 commented Jun 10, 2023

Issue #13109: Kill mutation for OneStatementPerLineCheck-2


check

https://checkstyle.org/config_coding.html#OneStatementPerLine


Mutation

<mutation unstable="false">
<sourceFile>OneStatementPerLineCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck</mutatedClass>
<mutatedMethod>&lt;init&gt;</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.MemberVariableMutator</mutator>
<description>Removed assignment to member variable forStatementEnd</description>
<lineContent>private int forStatementEnd = -1;</lineContent>
</mutation>
<mutation unstable="false">
<sourceFile>OneStatementPerLineCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck</mutatedClass>
<mutatedMethod>&lt;init&gt;</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.MemberVariableMutator</mutator>
<description>Removed assignment to member variable lambdaStatementEnd</description>
<lineContent>private int lambdaStatementEnd = -1;</lineContent>
</mutation>
<mutation unstable="false">
<sourceFile>OneStatementPerLineCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck</mutatedClass>
<mutatedMethod>&lt;init&gt;</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.MemberVariableMutator</mutator>
<description>Removed assignment to member variable lastStatementEnd</description>
<lineContent>private int lastStatementEnd = -1;</lineContent>
</mutation>
<mutation unstable="false">
<sourceFile>OneStatementPerLineCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.coding.OneStatementPerLineCheck</mutatedClass>
<mutatedMethod>&lt;init&gt;</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.MemberVariableMutator</mutator>
<description>Removed assignment to member variable lastVariableResourceStatementEnd</description>
<lineContent>private int lastVariableResourceStatementEnd = -1;</lineContent>
</mutation>


Regression

Report-1 :- https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/88d109b_2023082948/reports/diff/index.html

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


Diff Regression config: https://gist.githubusercontent.com/Kevin222004/3bd236a24ed8eacd760e6b12b47f7455/raw/97d7a64aa97fc35488a6db5d7345ee23ae9b9507/olc.xml
Diff Regression projects: https://gist.githubusercontent.com/Kevin222004/9600f179b602d4c971bdb0a050099005/raw/360a95ed7bb60d7a0956e531199d484c4d6f6617/test-projects.properties
Report label: Regression-2

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@github-actions
Copy link
Copy Markdown
Contributor

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.

Not all -1 are removed from code.

Real life code usually is not single line for whole class.
We kill survival try to make file that has whole code of class on single line.

It might be a reason on such -1 a fact that several years ago, checkstyle counted first line as 0 index. So not real become -1.
I think we now updated code to make first line as 1, so migration to 0 as non-existing, is ok.

Please double check, show evidences, and let's proceed.

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@Kevin222004
Copy link
Copy Markdown
Contributor Author

@romani I have added a test file in which all the code is in the same line
and change all the values to be 0.

Test look good their is no issue

@github-actions
Copy link
Copy Markdown
Contributor

@Kevin222004 Kevin222004 force-pushed the oneStat branch 2 times, most recently from d86ae08 to d36247a Compare June 18, 2023 18:17
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.

Items

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

@romani romani assigned rdiachenko and unassigned romani Jun 18, 2023
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 assigned Vyom-Yadav and unassigned rdiachenko Jun 21, 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!

@Vyom-Yadav Vyom-Yadav assigned romani and unassigned Vyom-Yadav Jun 23, 2023
@romani
Copy link
Copy Markdown
Member

romani commented Jun 24, 2023

Conflict

@romani romani merged commit 6cbca88 into checkstyle:master Jun 24, 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