Issue #13672: Kill mutation for SummaryJavaDocCheck-11#13329
Issue #13672: Kill mutation for SummaryJavaDocCheck-11#13329romani merged 1 commit intocheckstyle:masterfrom
Conversation
|
Github, generate report |
|
Report generation failed on phase "make_report", |
There was a problem hiding this comment.
@Kevin222004 Please generate the reports and update the PR desc with the rationale and reports. Fix the CI failures too.
|
Code coverage report :- https://kevin222004.github.io/Regression/ Please go through https://kevin222004.github.io/Regression/com.puppycrawl.tools.checkstyle.checks.javadoc/SummaryJavadocCheck.java.html#L647 |
romani
left a comment
There was a problem hiding this comment.
I am recalling approval, something strange happening.
|
@Kevin222004 , there is conflict and CI failures. |
|
Yes I solve the conflict but this is strange #13329 (comment) |
|
CI failure: |
|
@Kevin222004 , please finish this PR, this is AST based javadoc Check. |
|
@kevin The condition is redundant as:
This is one of those cases where pitest prevents from saving time. |
|
@Kevin222004 , CI is red |
|
@romani I fix this soon know in this case if pitest is happy then code coverage is not and if code coverage is happy then pitest is not. I update this. |
|
@Kevin222004 Please finish this PR, please ping if some help is required. |
| final DetailNode[] children = root.getChildren(); | ||
|
|
||
| for (int i = 0; !found; i++) { | ||
| for (int i = 0; true; i++) { |
There was a problem hiding this comment.
Replace this with a for-each loop.
There was a problem hiding this comment.
@Kevin222004 Replace this with a while loop, the condition:
child.getType() != JavadocTokenTypes.LEADING_ASTERISK && !CommonUtil.isBlank(child.getText())would always be executed as every Javadoc tree has EOF.
There was a problem hiding this comment.
@Kevin222004 , can we use findfirst pattern
https://stackoverflow.com/a/65074853/1015848
There was a problem hiding this comment.
#13329 (comment)
The way how the logic is set in loop we can't use it
|
Github, generate report |
1 similar comment
|
Github, generate report |
|
Github, generate report |
1a13176 to
03ac7fb
Compare
|
Github, generate report |
src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheck.java
Outdated
Show resolved
Hide resolved
|
While running this command on local |
|
@Kevin222004 , please try to workaround this failure in CI. |
src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheck.java
Show resolved
Hide resolved
7222d8c to
b5a670b
Compare
src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheck.java
Outdated
Show resolved
Hide resolved
src/main/java/com/puppycrawl/tools/checkstyle/checks/javadoc/SummaryJavadocCheck.java
Show resolved
Hide resolved
|
rebased |

Issue #13672: Kill mutation for SummaryJavaDocCheck-11
Check :-
https://checkstyle.org/checks/javadoc/summaryjavadoc.html#SummaryJavadoc
Mutation
checkstyle/config/pitest-suppressions/pitest-javadoc-suppressions.xml
Lines 912 to 919 in 3d8ed42
Explaination
The mutation is
for (int i = 0; !found; i++) {to change !found == true which has been into for each loop and after making this changes The coverage of code will be missing as #13329 (comment) looks like #13329 (comment).basically the extra code that has been changed is for the pattern like
and
where their is some text before
{@inheritDoc}soinstead of checking every node as per old code.
we can only check for
as per AST they are the only two possible token in which their may be a extra text before
{@inheritDoc}using this we can get the code coverage as well mutation coverage
Regression :-
Diff Regression config: https://gist.githubusercontent.com/Kevin222004/61eaa69fe98585b6ee1882ca082362bc/raw/316ca02ce9fd290119d9bfc560f2b11e84a1b685/Summary.xml
Diff Regression projects: https://gist.githubusercontent.com/Kevin222004/21e3934e85f802e2fbd48af06d122364/raw/604256badd733d8568064f371d55657c04b00dfd/test-projects-2.properties
Report label: Report-2