Skip to content

Issue #13109: Kill mutation for MagicNumber#13196

Merged
romani merged 1 commit intocheckstyle:masterfrom
Kevin222004:magicNum
Jun 14, 2023
Merged

Issue #13109: Kill mutation for MagicNumber#13196
romani merged 1 commit intocheckstyle:masterfrom
Kevin222004:magicNum

Conversation

@Kevin222004
Copy link
Copy Markdown
Contributor

@Kevin222004 Kevin222004 commented Jun 11, 2023

Issue #13109: Kill mutation for MagicNumber


Check :-

https://checkstyle.org/config_coding.html#MagicNumber


Mutation Covered

<mutation unstable="false">
<sourceFile>MagicNumberCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck</mutatedClass>
<mutatedMethod>isInHashCodeMethod</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.NakedReceiverMutator</mutator>
<description>replaced call to com/puppycrawl/tools/checkstyle/api/DetailAST::getParent with receiver</description>
<lineContent>DetailAST methodDefAST = ast.getParent();</lineContent>
</mutation>


Explaination :-

if we remove .getParent no issue will their because in loop it will be update by currentAST = currentAST.getParent(); so the loops run one timr more.


Regression

Diff Regression config: https://gist.githubusercontent.com/Kevin222004/6c454ec1c672a21710fc0cda01ceaf5b/raw/3fc36498aa1511c61c41cefb46ff02cdf8a1d2bb/magic.xml
Diff Regression projects: https://gist.githubusercontent.com/Kevin222004/21e3934e85f802e2fbd48af06d122364/raw/604256badd733d8568064f371d55657c04b00dfd/test-projects-2.properties
Report label: Report-2

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@github-actions
Copy link
Copy Markdown
Contributor

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@github-actions
Copy link
Copy Markdown
Contributor

@Kevin222004
Copy link
Copy Markdown
Contributor Author

@romani in semaphore eclipse static analysis in failing in all pr and not even loading the page
image
only this white screen is visible

@romani
Copy link
Copy Markdown
Member

romani commented Jun 11, 2023

Semaphore failure is same as in master branch. Ply ignore it for some time.

Please proceed with explanation of mutation killing.

@romani
Copy link
Copy Markdown
Member

romani commented Jun 11, 2023

Please keep links to such PRs in our issue for bad side effects of pitest, to have all examples at one place.

Copy link
Copy Markdown
Member

@romani romani left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok to merge

Copy link
Copy Markdown
Member

@Vyom-Yadav Vyom-Yadav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Copy Markdown
Member

@rdiachenko rdiachenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@romani there is a semaphore failure, what causes it do you know?

@rdiachenko rdiachenko assigned romani and unassigned rdiachenko Jun 12, 2023
@Kevin222004
Copy link
Copy Markdown
Contributor Author

@rdiachenko If you re run it will be resolved the pr for resolving it has been merged

@romani
Copy link
Copy Markdown
Member

romani commented Jun 14, 2023

Semaphore was resolved by #13201

All affected PRs must be rebased to avoid such problems.

@romani romani merged commit e7883d9 into checkstyle:master Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants