Issue #13328: Kill mutation for StringLiteralEqualityCheck#13277
Issue #13328: Kill mutation for StringLiteralEqualityCheck#13277romani merged 1 commit intocheckstyle:masterfrom
Conversation
|
Github, generate report |
|
Github, generate report |
|
Github, generate report |
|
Pitest CI is not happy |
6c37a9d to
b0db8b7
Compare
|
@romani I have make a slice change and added test case which are not to killed any mutation but to ensure that it only log violation to String literal if you think that it is not require tell me i will remove it |
|
Extra test is ok, keep it. |
|
@romani https://app.circleci.com/pipelines/github/checkstyle/checkstyle/19239/workflows/39d08198-14cf-42d2-ae2c-3659d268d821/jobs/321748 link check is not related to this pr should I cover that in this or create a minor one |
|
Please rebase, we released new layout of website, this is reason of failure |
|
Rebased |
|
Thnaks I was just going to do :) |
|
https://app.circleci.com/pipelines/github/checkstyle/checkstyle/19260/workflows/ba11568f-832b-43c0-8079-87dfa0932264/jobs/322206 I have noticed this simultaneously and don't know why it fails |
...wl/tools/checkstyle/checks/coding/stringliteralequality/InputStringLiteralEqualityCheck.java
Outdated
Show resolved
Hide resolved
|
so how can i fix this https://app.circleci.com/pipelines/github/checkstyle/checkstyle/19260/workflows/9b780f52-8241-4162-ad7f-981f564a94cd/jobs/322230 I want have much idea |
ac72ee3 to
73d5b6b
Compare
|
@Kevin222004 , you need to fix commit message to reference same issue as in description. |
Issue #13328: Kill mutation for StringLiteralEqualityCheck
Check :-
https://checkstyle.org/config_coding.html#StringLiteralEquality
Mutation :-
checkstyle/config/pitest-suppressions/pitest-coding-2-suppressions.xml
Lines 192 to 199 in ca00dfa
Explaination
Reomval of this will not make any issue
the ast
checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/StringLiteralEqualityCheck.java
Line 132 in ca00dfa
is always either
==or!=so while entering in the while loop ast is never going to be null so it will alwyas execute.
know lets suppose we have code like
so the ast look like
our ast would be
EQUAL -> == [14:14]and when it enetr the while loop the if will not executecheckstyle/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/StringLiteralEqualityCheck.java
Line 136 in ca00dfa
and result become true which is already set true by
checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/StringLiteralEqualityCheck.java
Line 117 in ca00dfa
so output will not effect and in the case if
if (s == "a" + "bc") {}the ast
here plus always become parent if it is used between string literal so if will execute
checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/StringLiteralEqualityCheck.java
Lines 136 to 139 in ca00dfa
and it will change ast to TokenTypes.Plus
Know as above explaintaion
this is also going to be the same as
checkstyle/src/main/java/com/puppycrawl/tools/checkstyle/checks/coding/StringLiteralEqualityCheck.java
Lines 117 to 118 in 3d8ed42
so removal of this both make not issue.
Regression :-
Report 1 :- https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/04dd886_2023175346/reports/diff/index.html
Report 2:- https://checkstyle-diff-reports.s3.us-east-2.amazonaws.com/04dd886_2023063730/reports/diff/index.html
Diff Regression config: https://gist.githubusercontent.com/Kevin222004/694cadb00ab976e27fd978d7bc8841a1/raw/8f4e4d48b33f7ccefab4cca495181c0236846380/StringLiteralEquality.xml
Diff Regression projects: https://gist.githubusercontent.com/Kevin222004/9600f179b602d4c971bdb0a050099005/raw/360a95ed7bb60d7a0956e531199d484c4d6f6617/test-projects.properties
Report label: R2