Skip to content

Issue #13328: Kill mutation for IllegalInstantiationCheck#13284

Merged
romani merged 1 commit intocheckstyle:masterfrom
Kevin222004:Ill
Jul 1, 2023
Merged

Issue #13328: Kill mutation for IllegalInstantiationCheck#13284
romani merged 1 commit intocheckstyle:masterfrom
Kevin222004:Ill

Conversation

@Kevin222004
Copy link
Copy Markdown
Contributor

@Kevin222004 Kevin222004 commented Jun 21, 2023

Issue #13328: Kill mutation for IllegalInstantiationCheck


Check :
https://checkstyle.org/config_coding.html#IllegalInstantiation


Mutation

<mutation unstable="false">
<sourceFile>IllegalInstantiationCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.coding.IllegalInstantiationCheck</mutatedClass>
<mutatedMethod>beginTree</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.MemberVariableMutator</mutator>
<description>Removed assignment to member variable pkgName</description>
<lineContent>pkgName = null;</lineContent>
</mutation>


Explaintaion

Tests Added


Diff Regression config: https://gist.githubusercontent.com/Kevin222004/3bd236a24ed8eacd760e6b12b47f7455/raw/97d7a64aa97fc35488a6db5d7345ee23ae9b9507/olc.xml
Diff Regression projects: https://gist.githubusercontent.com/Kevin222004/9600f179b602d4c971bdb0a050099005/raw/360a95ed7bb60d7a0956e531199d484c4d6f6617/test-projects.properties
Report label: Regression-1

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Github, generate report

@Kevin222004 Kevin222004 marked this pull request as draft June 21, 2023 12:18
@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 Kevin222004 force-pushed the Ill branch 2 times, most recently from 2b0116e to f305402 Compare June 24, 2023 07:56
@Kevin222004 Kevin222004 marked this pull request as ready for review June 24, 2023 08:00
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.

Items:


@Override
public void beginTree(DetailAST rootAST) {
pkgName = null;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As all reset before each file. We need test with the two files execution in one test.
First file with package, second is without package.
Second file should try to trigger violation related to same package name.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It is hard to find this in real life, because usually all have packages.
But our contract that all files randomly processed, without any context should affect any other file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

#13284 (comment) I have tried this. but I will give time once again to this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@romani Done.
Thanks :)

@Kevin222004 Kevin222004 changed the title Issue #13109: Kill mutation for IllegalInstantiationCheck Issue #13328: Kill mutation for IllegalInstantiationCheck Jul 1, 2023
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, just test was added

@romani romani merged commit 608599c into checkstyle:master Jul 1, 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.

2 participants