Skip to content

Issue #13321: Kill mutation for JavadocMethod-10#13356

Merged
romani merged 1 commit intocheckstyle:masterfrom
Kevin222004:JDM10
Aug 3, 2023
Merged

Issue #13321: Kill mutation for JavadocMethod-10#13356
romani merged 1 commit intocheckstyle:masterfrom
Kevin222004:JDM10

Conversation

@Kevin222004
Copy link
Copy Markdown
Contributor

@Kevin222004 Kevin222004 commented Jul 4, 2023

Issue #13321: Kill mutation for JavadocMethod-10


Check :-

https://checkstyle.org/checks/javadoc/javadocmethod.html#JavadocMethod


Mutation

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

and
<mutation unstable="false">
<sourceFile>JavadocMethodCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck</mutatedClass>
<mutatedMethod>leaveToken</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.MemberVariableMutator</mutator>
<description>Removed assignment to member variable currentClassName</description>
<lineContent>currentClassName = currentClassName.substring(0, dotIdx);</lineContent>
</mutation>
<mutation unstable="false">
<sourceFile>JavadocMethodCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck</mutatedClass>
<mutatedMethod>leaveToken</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.NakedReceiverMutator</mutator>
<description>replaced call to java/lang/String::substring with receiver</description>
<lineContent>currentClassName = currentClassName.substring(0, dotIdx);</lineContent>
</mutation>
<mutation unstable="false">
<sourceFile>JavadocMethodCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck</mutatedClass>
<mutatedMethod>leaveToken</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.NonVoidMethodCallMutator</mutator>
<description>removed call to java/lang/String::lastIndexOf</description>
<lineContent>final int dotIdx = currentClassName.lastIndexOf(&apos;$&apos;);</lineContent>
</mutation>
<mutation unstable="false">
<sourceFile>JavadocMethodCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck</mutatedClass>
<mutatedMethod>leaveToken</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.NonVoidMethodCallMutator</mutator>
<description>removed call to com/puppycrawl/tools/checkstyle/api/DetailAST::getType</description>
<lineContent>if (ast.getType() == TokenTypes.CLASS_DEF</lineContent>
</mutation>
<mutation unstable="false">
<sourceFile>JavadocMethodCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck</mutatedClass>
<mutatedMethod>leaveToken</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF</mutator>
<description>removed conditional - replaced equality check with true</description>
<lineContent>if (ast.getType() == TokenTypes.CLASS_DEF</lineContent>
</mutation>
<mutation unstable="false">
<sourceFile>JavadocMethodCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck</mutatedClass>
<mutatedMethod>leaveToken</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.NonVoidMethodCallMutator</mutator>
<description>removed call to com/puppycrawl/tools/checkstyle/api/DetailAST::getType</description>
<lineContent>|| ast.getType() == TokenTypes.ENUM_DEF</lineContent>
</mutation>
<mutation unstable="false">
<sourceFile>JavadocMethodCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck</mutatedClass>
<mutatedMethod>leaveToken</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF</mutator>
<description>removed conditional - replaced equality check with true</description>
<lineContent>|| ast.getType() == TokenTypes.ENUM_DEF</lineContent>
</mutation>
<mutation unstable="false">
<sourceFile>JavadocMethodCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck</mutatedClass>
<mutatedMethod>leaveToken</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.NonVoidMethodCallMutator</mutator>
<description>removed call to com/puppycrawl/tools/checkstyle/api/DetailAST::getType</description>
<lineContent>|| ast.getType() == TokenTypes.INTERFACE_DEF</lineContent>
</mutation>
<mutation unstable="false">
<sourceFile>JavadocMethodCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck</mutatedClass>
<mutatedMethod>leaveToken</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF</mutator>
<description>removed conditional - replaced equality check with true</description>
<lineContent>|| ast.getType() == TokenTypes.INTERFACE_DEF</lineContent>
</mutation>
<mutation unstable="false">
<sourceFile>JavadocMethodCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck</mutatedClass>
<mutatedMethod>leaveToken</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.NonVoidMethodCallMutator</mutator>
<description>removed call to com/puppycrawl/tools/checkstyle/api/DetailAST::getType</description>
<lineContent>|| ast.getType() == TokenTypes.RECORD_DEF) {</lineContent>
</mutation>
<mutation unstable="false">
<sourceFile>JavadocMethodCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck</mutatedClass>
<mutatedMethod>leaveToken</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_ELSE</mutator>
<description>removed conditional - replaced equality check with false</description>
<lineContent>|| ast.getType() == TokenTypes.RECORD_DEF) {</lineContent>
</mutation>
<mutation unstable="false">
<sourceFile>JavadocMethodCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck</mutatedClass>
<mutatedMethod>processClass</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.NonVoidMethodCallMutator</mutator>
<description>removed call to com/puppycrawl/tools/checkstyle/api/DetailAST::getText</description>
<lineContent>String innerClass = ident.getText();</lineContent>
</mutation>
<mutation unstable="false">
<sourceFile>JavadocMethodCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocMethodCheck</mutatedClass>
<mutatedMethod>processClass</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.NakedReceiverMutator</mutator>
<description>replaced call to com/puppycrawl/tools/checkstyle/api/DetailAST::findFirstToken with receiver</description>
<lineContent>final DetailAST ident = ast.findFirstToken(TokenTypes.IDENT);</lineContent>
</mutation>


Explaination

I found this code non used


Regression :-

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

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


Diff Regression config: https://gist.githubusercontent.com/Kevin222004/df2ff7a8f9969bb2c68d7251a97ffa8b/raw/6a4e81a624fa36483f23b0adcf1fc513ca6df350/JavadocMethod.xml
Diff Regression projects: https://gist.githubusercontent.com/Kevin222004/21e3934e85f802e2fbd48af06d122364/raw/604256badd733d8568064f371d55657c04b00dfd/test-projects-2.properties
Report label: Regression-1

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@Kevin222004 Kevin222004 marked this pull request as draft July 4, 2023 12:37
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 4, 2023

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 4, 2023

@Kevin222004 Kevin222004 marked this pull request as ready for review July 4, 2023 17:25
@Kevin222004 Kevin222004 marked this pull request as draft July 6, 2023 09:04
@romani
Copy link
Copy Markdown
Member

romani commented Jul 30, 2023

@Kevin222004 , please resovle conflict and prepare PR for review.

@Kevin222004 Kevin222004 marked this pull request as ready for review July 30, 2023 16:27
@Kevin222004
Copy link
Copy Markdown
Contributor Author

#13356 (comment) done ci passed

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.
Impressive!

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 Jul 31, 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!

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