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
minor: add missing test case to SuperCloneCheckTest #7494
Conversation
@pbludov please ensure you are on the latest master for the PR. Failures look related to that. I assume pitest is not failing in master? So why isn't this fix as part of the other PR since that is where problem is? |
done
This is not a part of #7487 |
If pitest is not failing master then how is it a blocker for another PR but not related to that PR? I see in other PR
It doesn't look like its an issue with the mutator but maybe with the compiler, as pitest deals with the byte code and it can vary from compiler to compiler. http://rveach.no-ip.org/checkstyle/regression/pitest-reports/36/pitest-coding/com.puppycrawl.tools.checkstyle.checks.coding/AbstractSuperCheck.java.html#org.pitest.mutationtest.report.html.SourceFile@4038323f_139 I just re-ran the report on Windows 7 and the line has 6 mutations and does not reach 100%.
The whole package has other areas that are not reaching 100%. AbstractSuperCheck, DeclarationOrderCheck, MagicNumberCheck are the checks in question. Windows run total mutation count for package:
Linux run total mutation count for package:
Windows run added almost 113 more mutations than linux, and 7 are failing to be killed. List of active mutators did not change between runs. List is on the bottom of each class. Other classes missing coverage are not the same mutators, so no visible direct relation to each class. I recommend we report the issue to pitest. @romani ping |
@pbludov , as this minor become so controversial ..... please put all details in PR description and use prefix in commit |
I am no longer able to reproduce the issue on my Windows. I thought I had it, but its not happening now and I don't know what I did to produce it the first time. I am thinking somehow eclipse/maven went through enough recompiles to change the byte code significantly. |
I can confirm that this issue is fluky. I'll try to extract a small example to report it to the Pitest team. |
@rnveach, please finalize review, pitest issue should not block this PR |
I think i know what is going on. For the Java code (new version) private static boolean hasArguments(DetailAST methodCallDotAst) {
final DetailAST argumentsList = methodCallDotAst.getNextSibling();
return argumentsList.hasChildren();
} the bytecode is
For the Java code (original version) private static boolean hasArguments(DetailAST methodCallDotAst) {
final DetailAST argumentsList = methodCallDotAst.getNextSibling();
return argumentsList.getChildCount() > 0;
} the bytecode is
The mutator BooleanFalseReturnValsMutator changes Then there comes the filter This is a bug in the Pitest library. Once my example will be ready to discuss, I'll start an issue on Pitest tracker. |
Discovered here
JFYI: the Pitest can not appy
BooleanFalseReturnValsMutator
to code likereturn a > b
.After extracting a local variable,
the mutator
BooleanFalseReturnValsMutator
is able to add the mutation and the missing coverage is detected.This PR adds the missing case.