Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve Pitest Suppression in Pitest-Javadoc Profile #13999

Open
13 of 50 tasks
Kevin222004 opened this issue Nov 6, 2023 · 14 comments
Open
13 of 50 tasks

Resolve Pitest Suppression in Pitest-Javadoc Profile #13999

Kevin222004 opened this issue Nov 6, 2023 · 14 comments

Comments

@Kevin222004
Copy link
Contributor

Kevin222004 commented Nov 6, 2023

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

  1. Project-list-1
  2. Project-list-2
  3. 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.

1) JavadocParagraphCheck

  • MemberVariableMutator on DetailNode newLine = JavadocUtil.getPreviousSibling(node)

3) JavadocStyleCheck

  • NonVoidMethodCallMutator on builder.deleteCharAt(index)
  • NonVoidMethodCallMutator on if (Character.isWhitespace(builder.charAt(index)))
  • NonVoidMethodCallMutator on if (Character.isWhitespace(builder.charAt(index)))
  • RemoveConditionalMutator_EQUAL_ELSE on if (Character.isWhitespace(builder.charAt(index))) {
  • RemoveConditionalMutator_EQUAL_ELSE on if (Character.isWhitespace(builder.charAt(index))) {
  • RemoveConditionalMutator_EQUAL_IF on if (Character.isWhitespace(builder.charAt(index)))
  • RemoveIncrementsMutator on index += 2;
  • NakedReceiverMutator on builder.deleteCharAt(index)

4) JavadocMethodCheck

  • ArgumentPropagationMutator on final int col = calculateTagColumn(noargCurlyMatcher, i, startColumnNumber)
  • NonVoidMethodCallMutator on .getColumnNo());
  • NonVoidMethodCallMutator on final Token token = new Token(tag.getFirstArg(), tag.getLineNo(), tag
  • NonVoidMethodCallMutator 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_TRY
  • RemoveConditionalMutator_EQUAL_IF on return surroundingAccessModifier != null
  • NakedReceiverMutator on final DetailAST blockAst = methodAst.findFirstToken(TokenTypes.SLIST)
  • NakedReceiverMutator on DetailAST ancestor = throwAst.getParent();

2) JavadocMethodCheck$Token

  • NonVoidMethodCallMutator on columnNo = fullIdent.getColumnNo();
  • NonVoidMethodCallMutator - Issue #13321: Kill mutation for JavadocMethod-7 #13342
  • MemberVariableMutator on columnNo = fullIdent.getColumnNo();
  • MemberVariableMutator on lineNo = fullIdent.getLineNo();
  • MemberVariableMutator on lineNo = fullIdent.getLineNo()

5) JavadocNodeImpl

  • NonVoidMethodCallMutator on + ", children=" + Objects.hashCode(children)

6) JavadocTagInfo$15


7) JavadocTagInfo$14


8) JavadocTagInfo$11


9) TagParser

  • ArgumentPropagationMutator on Point position = findChar(text, '<', new Point(0, 0))
  • ArgumentPropagationMutator on toPoint = findChar(text, '>', getNextPoint(text, toPoint))
  • ArgumentPropagationMutator on toPoint = findChar(text, '>', toPoint)
  • NonVoidMethodCallMutator on (Character.isJavaIdentifierStart(text.charAt(position))
  • NonVoidMethodCallMutator on (Character.isJavaIdentifierStart(text.charAt(position))
  • RemoveConditionalMutator_EQUAL_ELSE on if (incompleteTag) {
  • RemoveConditionalMutator_EQUAL_ELSE on .substring(0, toPoint.getColumnNo() + 1).endsWith("-->"))
  • RemoveConditionalMutator_EQUAL_IF on (Character.isJavaIdentifierStart(text.charAt(position))
  • NakedReceiverMutator on text = text.substring(column).trim()
  • RemoveConditionalMutator_ORDER_ELSE while (toPoint.getLineNo() < text.length && !text[toPoint.getLineNo()]

10) AbstractJavadocCheck

  • NonVoidMethodCallMutator on JavadocUtil.getTokenName(javadocTokenId), getClass().getName())
  • NonVoidMethodCallMutator on avadocToken, getClass().getName()
  • NonVoidMethodCallMutator on blockCommentNode.getColumnNo())
  • NonVoidMethodCallMutator on waitsForProcessing = shouldBeProcessed(curNode);
  • RemoveConditionalMutator_EQUAL_ELSE on if (curNode != null) {
  • RemoveConditionalMutator_EQUAL_IF on if (getRequiredJavadocTokens().length != 0)
  • RemoveConditionalMutator_EQUAL_IF on if (toVisit == null) {
    Issue #13501: Kill mutation for AbstarctJavadoc #13602
suniti0804 added a commit to suniti0804/checkstyle that referenced this issue Nov 13, 2023
suniti0804 added a commit to suniti0804/checkstyle that referenced this issue Nov 13, 2023
…cCheck validateDefaultJavadocTokens() method
romani pushed a commit that referenced this issue Nov 13, 2023
@github-actions github-actions bot added this to the 10.12.5 milestone Nov 13, 2023
suniti0804 added a commit to suniti0804/checkstyle that referenced this issue Nov 16, 2023
suniti0804 added a commit to suniti0804/checkstyle that referenced this issue Nov 16, 2023
@nrmancuso
Copy link
Member

@Kevin222004 why aren’t we referencing #12341 (comment) and why are we rewriting the pitest procedure here?

@romani
Copy link
Member

romani commented Nov 16, 2023

Javadoc are very special group, we less demanding to prove that code is required. We know already that implementation of such checks are very error prone, so if regression can not be found by regression, code should be removed.

If there will be regression, we are sorry and we will fix easily in next release.

This rule is not applicable to AST based javadoc Checks, we might do the same for Indentation module ( I am not sure).

This rule is not applicable to #14019 .

@suniti0804
Copy link
Contributor

I am on JavadocParagraphCheck

suniti0804 added a commit to suniti0804/checkstyle that referenced this issue Dec 4, 2023
suniti0804 added a commit to suniti0804/checkstyle that referenced this issue Dec 4, 2023
@github-actions github-actions bot modified the milestones: 10.12.5, 10.12.6 Dec 5, 2023
mahfouz72 added a commit to mahfouz72/checkstyle that referenced this issue Feb 16, 2024
@mahfouz72
Copy link
Member

i am on text = text.substring(column).trim()

mahfouz72 added a commit to mahfouz72/checkstyle that referenced this issue Feb 16, 2024
mahfouz72 added a commit to mahfouz72/checkstyle that referenced this issue Feb 16, 2024
@Coding-Aliens
Copy link
Contributor

I am on foundThrows.add(documentedClassInfo.getName().getText())

Coding-Aliens pushed a commit to Coding-Aliens/checkstyle that referenced this issue Feb 23, 2024
Bumps [com.google.truth:truth](https://github.com/google/truth) from 1.2.0 to 1.3.0.
- [Release notes](https://github.com/google/truth/releases)
- [Commits](google/truth@v1.2.0...v1.3.0)

---
updated-dependencies:
- dependency-name: com.google.truth:truth
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Issue checkstyle#6207: Enale XpathRegressionTest for IlegalTokenText

dependency: bump org.pitest:pitest-maven from 1.15.3 to 1.15.4

Bumps [org.pitest:pitest-maven](https://github.com/hcoles/pitest) from 1.15.3 to 1.15.4.
- [Release notes](https://github.com/hcoles/pitest/releases)
- [Commits](hcoles/pitest@1.15.3...1.15.4)

---
updated-dependencies:
- dependency-name: org.pitest:pitest-maven
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Issue checkstyle#13213: removed //ok metrics,design

Issue checkstyle#13213: Removed //ok from leftout files

Issue checkstyle#13999: Resolve pitest suppression for throwAst.getParent() of JavadocMethod

Issue checkstyle#13213: Removed //ok noncompilable/naming

dependency: bump org.pitest:pitest-maven from 1.15.4 to 1.15.6

Bumps [org.pitest:pitest-maven](https://github.com/hcoles/pitest) from 1.15.4 to 1.15.6.
- [Release notes](https://github.com/hcoles/pitest/releases)
- [Commits](hcoles/pitest@1.15.4...1.15.6)

---
updated-dependencies:
- dependency-name: org.pitest:pitest-maven
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Issue checkstyle#11163: Enforced file size inputs

Issue checkstyle#6207: Add XPath IT Regression test for CatchParameterName

Issue checkstyle#11163: Enforced filesize commentsindentation

Issue checkstyle#13213: removed //ok noncompilable/sizes

Issue checkstyle#13213: Removed //ok from methodcount

Issue checkstyle#11163: enforced filesize MissingJavadocTypeTags

Issue checkstyle#6207: Enable XpathRegressiontest for EqualsHashCode

Issue checkstyle#13213: Removed //ok from nolinewrap

Issue checkstyle#13213: Removed //ok from declarationorder

Issue checkstyle#14137: Enable `MockitoStubbing` check

Issue checkstyle#13213: removed //ok noncompilable/whitespace

Issue checkstyle#13345: Enable StaticVariableNameCheckExamplesTest

Issue checkstyle#14137: Enable `TimeZoneUsage` check

Issue checkstyle#11163: Enforced filesize TypeNoJavadoc1

doc: release notes for 10.13.0

[maven-release-plugin] prepare release checkstyle-10.13.0

[maven-release-plugin] prepare for next development iteration

doc: fix releasenotes.xml line length violation

Issue# 13999: RemoveConditionalMutator_EQUAL_IF on if (child.getType() == TokenTypes.PARAMETER_DEF)
Coding-Aliens added a commit to Coding-Aliens/checkstyle that referenced this issue Feb 23, 2024
Coding-Aliens added a commit to Coding-Aliens/checkstyle that referenced this issue Feb 23, 2024
Rohanraj123 added a commit to Rohanraj123/checkstyle that referenced this issue Feb 25, 2024
MANISH-K-07 added a commit to MANISH-K-07/checkstyle that referenced this issue Feb 26, 2024
MANISH-K-07 added a commit to MANISH-K-07/checkstyle that referenced this issue Feb 26, 2024
mahfouz72 added a commit to mahfouz72/checkstyle that referenced this issue Feb 27, 2024
mahfouz72 added a commit to mahfouz72/checkstyle that referenced this issue Feb 27, 2024
Rohanraj123 added a commit to Rohanraj123/checkstyle that referenced this issue Feb 27, 2024
Rohanraj123 added a commit to Rohanraj123/checkstyle that referenced this issue Mar 1, 2024
TanayMorakhia added a commit to TanayMorakhia/checkstyle that referenced this issue Mar 6, 2024
…tJavadocTokens method of AbstractJavadocCheck
TanayMorakhia added a commit to TanayMorakhia/checkstyle that referenced this issue Mar 7, 2024
…tJavadocTokens method of AbstractJavadocCheck
TanayMorakhia added a commit to TanayMorakhia/checkstyle that referenced this issue Mar 9, 2024
…tJavadocTokens method of AbstractJavadocCheck
romani pushed a commit that referenced this issue Mar 15, 2024
@github-actions github-actions bot modified the milestones: 10.14.0, 10.14.2 Mar 15, 2024
@github-actions github-actions bot modified the milestones: 10.14.2, 10.15.0 Mar 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants