As a part of this issue, we have to kill the mutation listed below and remove the suppression from pitest-javadoc-suppression.xml
How to Kill the Mutation
1) Take 1 mutation and apply to the code
Pick up the one mutation from the pitest-javadoc-suppression.xml file or for better understanding you can generate the pitest report as well by Following Steps
and finally hardcode the mutation.
How to hardcode the mutation
For better understanding of mutatnt, That how it works. Please checkout Pitest Doc In this you will find the detail explaination of each mutant with example.
2) Send the pr and generate the report
After hardcoding the code please send a pull request and try to generate the regression Report. If Regression report found the diff then you got your test cases. use that part of code as your input and create a test.
How to generate the Regression Report
To learn how to generate the regression report Please go through the Following link.
https://github.com/checkstyle/contribution/tree/master/checkstyle-tester#report-generation
After reading this you found the 2 method two genrate the report please try to generate the report with Github Action.
For example https://github.com/checkstyle/contribution/tree/master/checkstyle-tester#generation-examples
Basically you have to generate the 2 report in with project file
- Project-list-1
- Project-list-2
- Project-list-3
3) Removal of code
If no diff found from all the report just follow the mutation apply the changes and update the pr.
Apart of this for more detailed explaination please go through Wiki-Page and Pit Documentation
Example of how we did not find by report test case that kill mutation #13342 and we simply updated code as pitest mutated.
Example of how to share analytical explanation on why removal of code is ok - #14410
List of survivals to kill mutation
please always choose single mutation for Pull Request.
<mutation unstable="false">
<sourceFile>JavadocTagInfo.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTagInfo$15</mutatedClass>
<mutatedMethod>isValidOn</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF</mutator>
<description>removed conditional - replaced equality check with true</description>
<lineContent>&& varType.getFirstChild().getType() == TokenTypes.ARRAY_DECLARATOR</lineContent>
</mutation>
<mutation unstable="false">
<sourceFile>JavadocTagInfo.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocTagInfo$15</mutatedClass>
<mutatedMethod>isValidOn</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.RemoveConditionalMutator_EQUAL_IF</mutator>
<description>removed conditional - replaced equality check with true</description>
<lineContent>return astType == TokenTypes.VARIABLE_DEF</lineContent>
</mutation>
Abandoned work but might be good to look at:
#13601
#13600
Already done mutation kills:
1) JavadocParagraphCheck
3) JavadocStyleCheck
4) JavadocMethodCheck
2) JavadocMethodCheck$Token
5) JavadocNodeImpl
6) JavadocTagInfo$15
7) JavadocTagInfo$14
8) JavadocTagInfo$11
9) TagParser
10) AbstractJavadocCheck
As a part of this issue, we have to kill the mutation listed below and remove the suppression from pitest-javadoc-suppression.xml
How to Kill the Mutation
1) Take 1 mutation and apply to the code
Pick up the one mutation from the pitest-javadoc-suppression.xml file or for better understanding you can generate the pitest report as well by Following Steps
and finally hardcode the mutation.
How to hardcode the mutation
For better understanding of mutatnt, That how it works. Please checkout Pitest Doc In this you will find the detail explaination of each mutant with example.
2) Send the pr and generate the report
After hardcoding the code please send a pull request and try to generate the regression Report. If Regression report found the diff then you got your test cases. use that part of code as your input and create a test.
How to generate the Regression Report
To learn how to generate the regression report Please go through the Following link.
https://github.com/checkstyle/contribution/tree/master/checkstyle-tester#report-generation
After reading this you found the 2 method two genrate the report please try to generate the report with Github Action.
For example https://github.com/checkstyle/contribution/tree/master/checkstyle-tester#generation-examples
Basically you have to generate the 2 report in with project file
3) Removal of code
If no diff found from all the report just follow the mutation apply the changes and update the pr.
Apart of this for more detailed explaination please go through Wiki-Page and Pit Documentation
Example of how we did not find by report test case that kill mutation #13342 and we simply updated code as pitest mutated.
Example of how to share analytical explanation on why removal of code is ok - #14410
List of survivals to kill mutation
please always choose single mutation for Pull Request.
Abandoned work but might be good to look at:
#13601
#13600
Already done mutation kills:
1) JavadocParagraphCheck
DetailNode newLine = JavadocUtil.getPreviousSibling(node)3) JavadocStyleCheck
builder.deleteCharAt(index)if (Character.isWhitespace(builder.charAt(index)))if (Character.isWhitespace(builder.charAt(index)))if (Character.isWhitespace(builder.charAt(index))) {if (Character.isWhitespace(builder.charAt(index))) {if (Character.isWhitespace(builder.charAt(index)))index += 2;builder.deleteCharAt(index)4) JavadocMethodCheck
NonVoidMethodCallMutator on
columnNo = fullIdent.getColumnNo()MemberVariableMutator on
columnNo = fullIdent.getColumnNo()NonVoidMethodCallMutator on
.lineNo = fullIdent.getLineNo();MemberVariableMutator on
lineNo = fullIdent.getLineNo();ArgumentPropagationMutator on
final int col = calculateTagColumn(noargCurlyMatcher, i, startColumnNumber)NonVoidMethodCallMutator on
final Token token = new Token(tag.getFirstArg(), tag.getLineNo(), tagNonVoidMethodCallMutator on
final int col = calculateTagColumn(noargCurlyMatcher, i, startColumnNumber)NonVoidMethodCallMutator on
foundThrows.add(documentedClassInfo.getName().getText())NonVoidMethodCallMutator on
foundThrows.add(documentedClassInfo.getName().getText())RemoveConditionalMutator_EQUAL_ELSE on
if (class1.contains(separator) || class2.contains(separator)) {RemoveConditionalMutator_EQUAL_IF on
if (arg1.startsWith(ELEMENT_START) && arg1.endsWith(ELEMENT_END))RemoveConditionalMutator_EQUAL_IF on
if (child.getType() == TokenTypes.PARAMETER_DEF) {RemoveConditionalMutator_EQUAL_IF on
if (class1.contains(separator) || class2.contains(separator)) {RemoveConditionalMutator_EQUAL_IF on
if (ancestor.getType() == TokenTypes.LITERAL_TRYRemoveConditionalMutator_EQUAL_IF on
return surroundingAccessModifier != nullNakedReceiverMutator on
final DetailAST blockAst = methodAst.findFirstToken(TokenTypes.SLIST)NakedReceiverMutator on
DetailAST ancestor = throwAst.getParent();2) JavadocMethodCheck$Token
columnNo = fullIdent.getColumnNo();columnNo = fullIdent.getColumnNo();lineNo = fullIdent.getLineNo();lineNo = fullIdent.getLineNo()5) JavadocNodeImpl
+ ", children=" + Objects.hashCode(children)6) JavadocTagInfo$15
varType.getFirstChild().getType() == TokenTypes.ARRAY_DECLARATORreturn astType == TokenTypes.VARIABLE_DEIssue #13501: Kill mutation for JavadocTagInfo4 #13601
Issue #13501: Kill mutation for JavadocTagInfo3 #13600
7) JavadocTagInfo$14
return astType == TokenTypes.METHOD_DEFIssue #13501: Kill mutation for JavadocTagInfo2 #13599
8) JavadocTagInfo$11
return astType == TokenTypes.METHOD_DEFIssue #13501: Kill mutation for JavadocTagInfo #13598.
9) TagParser
Point position = findChar(text, '<', new Point(0, 0))toPoint = findChar(text, '>', getNextPoint(text, toPoint))toPoint = findChar(text, '>', toPoint)(Character.isJavaIdentifierStart(text.charAt(position))(Character.isJavaIdentifierStart(text.charAt(position))if (incompleteTag) {.substring(0, toPoint.getColumnNo() + 1).endsWith("-->"))(Character.isJavaIdentifierStart(text.charAt(position))text = text.substring(column).trim()while (toPoint.getLineNo() < text.length && !text[toPoint.getLineNo()]10) AbstractJavadocCheck
JavadocUtil.getTokenName(javadocTokenId), getClass().getName())avadocToken, getClass().getName()blockCommentNode.getColumnNo())waitsForProcessing = shouldBeProcessed(curNode);if (curNode != null) {if (getRequiredJavadocTokens().length != 0)if (toVisit == null) {Issue #13501: Kill mutation for AbstarctJavadoc #13602