Skip to content
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

Resolve Pitest Issues - AvoidStarImportCheck (2) #7800

Closed
rnveach opened this issue Mar 8, 2020 · 5 comments
Closed

Resolve Pitest Issues - AvoidStarImportCheck (2) #7800

rnveach opened this issue Mar 8, 2020 · 5 comments

Comments

@rnveach
Copy link
Member

rnveach commented Mar 8, 2020

Child issue of #7797 ,

This issue specifically focuses on the line

"AvoidStarImportCheck.java.html:<td class='covered'><pre><span class='survived'> if (exclude.endsWith(STAR_IMPORT_SUFFIX)) {</span></pre></td></tr>"

@HuGanghui
Copy link
Contributor

I am on it

@HuGanghui
Copy link
Contributor

HuGanghui commented Mar 13, 2020

Pitest report

Link: https://huganghui.github.io/7800-AvoidStarImportCheck(2)/before-pit-reports/202003131405/
Surviving mutations:
on line 188: removed conditional - replaced equality check with false → SURVIVED I am focusing on it.
on line 224: removed conditional - replaced equality check with true → SURVIVED referenced by #7799, wilcoln is focusing on it.

Hardcoded mutation

mutation cs branch: HuGanghui@1578ac0
comment:
Looking at the pitest report, we can see that the surviving mutation is the one for which removed conditional - replaced equality check with false → SURVIVED, this is equivalent as simply removing the entire condition and keeping only the else body. Which I did.

Regression diff report

Used only guava and elastic-search, but there is no diff found.
Link: https://huganghui.github.io//7800-AvoidStarImportCheck(2)/hardcoded-reports/diff/

Code Logic Analysis
Although there is no diff found in Regression diff report, I find that the reason why the surviving mutation exists is maybe a small oversight in an existing UT , details as follows:

"java.io,java.lang,javax.swing.WindowConstants.*, javax.swing.WindowConstants");

javax.swing.WindowConstants is redundant in this UT, so I remove this import and do Pitest, report shows it can kill the mutation.

@wilcoln
Copy link
Contributor

wilcoln commented Mar 13, 2020

Hi bro,
You might want to remove the following part of my comment from yours because it doesn't apply to your case.

.. , this is equivalent as simply removing it. Which I did, leaving us with only the second condition...

I believe what you want to say is

.. , this is equivalent as simply removing the entire condition and keeping only the else body. Which I did.

@HuGanghui
Copy link
Contributor

@wilcoln ok, Thanks~, your statement is more accurate.

@strkkk
Copy link
Member

strkkk commented Mar 15, 2020

Fix is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants