Skip to content

Issue #13328: Kill mutation for EqualsAvoidNullCheck 4#13127

Merged
rdiachenko merged 1 commit intocheckstyle:masterfrom
Kevin222004:EV4
Jul 3, 2023
Merged

Issue #13328: Kill mutation for EqualsAvoidNullCheck 4#13127
rdiachenko merged 1 commit intocheckstyle:masterfrom
Kevin222004:EV4

Conversation

@Kevin222004
Copy link
Copy Markdown
Contributor

@Kevin222004 Kevin222004 commented Jun 1, 2023

Issue #13328: Kill mutation for EqualsAvoidNullCheck 4

covering

<mutation unstable="false">
<sourceFile>EqualsAvoidNullCheck.java</sourceFile>
<mutatedClass>com.puppycrawl.tools.checkstyle.checks.coding.EqualsAvoidNullCheck$FieldFrame</mutatedClass>
<mutatedMethod>getMethodCalls</mutatedMethod>
<mutator>org.pitest.mutationtest.engine.gregor.mutators.experimental.ArgumentPropagationMutator</mutator>
<description>replaced call to java/util/Collections::unmodifiableSet with argument</description>
<lineContent>return Collections.unmodifiableSet(methodCalls);</lineContent>
</mutation>

@Kevin222004
Copy link
Copy Markdown
Contributor Author

GitHub, generate report

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jun 1, 2023

@Kevin222004 Kevin222004 marked this pull request as draft June 2, 2023 05:01
@Kevin222004 Kevin222004 marked this pull request as ready for review June 2, 2023 12:55
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:

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:

pom.xml Outdated
<param>com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanReturnCheckTest</param>
</targetTests>
<avoidCallsTo>
<avoidCallsTo>java.util.Collections</avoidCallsTo>
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.

This is too broad exclusion.
Can we narrow to Collections.unmodifiableSet ?

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.

If there is no way , please prove it .

Absolutely last resort: we can wrap such method in checkstyle util method and exclude by our class.

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.

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.

Absolutely last resort: we can wrap such method in checkstyle util method and exclude by our class.

I am not getting you on this, if we will create and call such kind of method we have to pass the parameter and hence it is not making any difference right know with Collections.unmodifiableSet so it will also not make any impact withour new mwthod as well it will again a pit failure as a argument propagation one

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.

Create class in our project with name UnmodifableCollectionUtil
Make method

unmodifiableSet(collection){
 return Collections.unmodifiableSet(collection);
}

Add javadoc to this class to explain reason of wrapping of jdk method.
Add our class to pitest config for no mutation.

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.

Please ALWAYS share links to what is done.

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.

Share a link please

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.

Actually I have posted on mailing list which is not public if they reply then it will visible but i will share on their issue by today

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.

That is why better to open ticket on GitHub. In worse case they will close it won't fix. It gives all others from world to participate and support idea

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.

That is why better to open ticket on GitHub. In worse case they will close it won't fix. It gives all others from world to participate and support idea

Yes, from next time will take care of this

I have opened an issue hcoles/pitest#1233

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:

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:

@romani
Copy link
Copy Markdown
Member

romani commented Jun 17, 2023

There is conflict, and waiting for input test

@Kevin222004
Copy link
Copy Markdown
Contributor Author

There is conflict, and waiting for input test

To be honest I have given a time to create a input based test but I really don't find anything so i have leaved as it is.
all though to me as well this is on top priority to complete the whole coding-1 profile.

I will give once again time and try to find something

@Kevin222004
Copy link
Copy Markdown
Contributor Author

Kevin222004 commented Jun 18, 2023

@romani please start reviewing other pull request they are ready ci failures are not related to changes

@Kevin222004
Copy link
Copy Markdown
Contributor Author

@romani if you don't have any issue can I Suppress the UnmodifableCollectionUtil class from the util profile as well.
code we can cover code coverage with input but to kill this (return Collections.unmodifiableSet(collection); here this is mutated as collection )mutation with input is difficult

@romani
Copy link
Copy Markdown
Member

romani commented Jun 19, 2023

Please resolve conflict

@Kevin222004 Kevin222004 force-pushed the EV4 branch 2 times, most recently from 1e6340f to 15f39c6 Compare June 19, 2023 09:34
@Kevin222004
Copy link
Copy Markdown
Contributor Author

@romani I have updated the branch with input based testing but i have suppress our new class from util profile

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:

@Kevin222004 Kevin222004 force-pushed the EV4 branch 4 times, most recently from 25c6765 to 6d7aa1e Compare June 21, 2023 07:49
@Kevin222004 Kevin222004 force-pushed the EV4 branch 4 times, most recently from d061dd2 to 0d1907c Compare June 26, 2023 15:34
@romani romani self-assigned this Jun 27, 2023
@romani
Copy link
Copy Markdown
Member

romani commented Jun 28, 2023

I still don't see answers to my questions.

@Kevin222004 Kevin222004 force-pushed the EV4 branch 3 times, most recently from d68eff0 to 523b263 Compare June 28, 2023 15:28
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

@Kevin222004 Kevin222004 changed the title Issue #13109: Kill mutation for EqualsAvoidNullCheck 4 Issue #13328: Kill mutation for EqualsAvoidNullCheck 4 Jun 30, 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

@romani
Copy link
Copy Markdown
Member

romani commented Jun 30, 2023

@Kevin222004 , please update linkcheck suppression file.

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!

@Vyom-Yadav Vyom-Yadav assigned rdiachenko and unassigned Vyom-Yadav Jul 2, 2023
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

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