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
Issue #7921: Resolve Pitest Issues - UnusedImportsCheck #7937
Conversation
Diff is not enough. Only 1 instance was used while check has multiple properties.
Prove to me without a doubt that the best way forward is to remove the variable. Did you check the history of the variable and see why it was added in the first place?
Not every Java class will have a package. |
Report Updated
You are right
The code will run processIdent(ast); only if the current type is IDENT and collect is true
So the logic now is the same but I moved first if branch to process in the right place without variable |
Diff is good now.
This was not answered.
You can make that assumption but you have to remember the order of the ASTs coming in. The first 3 checks are IDENT, IMPORT, STATIC IMPORT and everything else falls in the else. To me it seems the purpose of Example:
You see what I am saying? I am still not convinced. My statement above, in my eye, shows the logic for having the variable and it's check. Now I want to know why regression didn't find anything. What happens in the mutated branch when we executed with ASTs that would have been blocked in the unmutated branch such that a difference in violations don't occur. |
@AmrDeveloper , please rebase to resolve conflict. |
@rnveach You are right in your example
and we can see the difference between old code and new code
or
so if we changed the implementation to make baseClassName return for example "" if it can't find at last one dots so the problem now how we can make UT that can show the difference between two solutions like import.test and make regression fail with new code |
I would not focus on differentiating between import and import static. The purpose of this is to prove why we need
I would focus on this from my above statement. What happens if we collect an INDENT we shouldn't be collecting? How can we use that to kill the mutation with a new UT? |
@rnveach |
Yes. I would next look at what IDENTs it is collecting and how it uses IDENTs and does it use them to determine if a violation is done or not. |
@AmrDeveloper , are you stuck , do you need help ? |
@romani Sorry for delay i will try again to find another solution without take more memory resource |
@rnveach |
Issue #7921
Description:
We don't need the variable collect to check if we should start collecting or not because it will always true because every java fill will contain package keyword or class that will make collect = true
Reports:
Diff Report : https://amrdeveloper.github.io/checkstyle-reports/7921/diff/
pitest-after : https://amrdeveloper.github.io/checkstyle-reports/7921/pitest-after
pitest-before : https://amrdeveloper.github.io/checkstyle-reports/7921/pitest-before/