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
Investigate is it possible to check duplicates of generated mutators (physical and logical) #1838
Comments
One idea that I have right now, since the mutation is based on php-parser, is. This normalized version can be used as the caching key. -- Edit: |
I think it should be placed here: infection/src/Mutator/NodeMutationGenerator.php Lines 91 to 111 in 8042277
Before the |
Or does it make more sense to have this only for logical mutators? Like here: infection/src/Mutator/Boolean/LogicalAndAllSubExprNegation.php Lines 77 to 80 in 71b2fb9
So that each logical mutator has to call some |
Spent a couple of hours investigating it, here are my thoughts (they also answer to your questions):
I also did a small PoC to throw an exception in the code if duplicated Mutant is created (any one, not just logical) by comparing hashes of generated mutated code to find duplicates, I will prepare a PR soon. Though It doesn't solve the root issue, just finds duplicates in generated changed code |
Good finding. Generally, I would go for approach 2 first. Writing a "truth table" test for those might be another addition to that. |
Originally posted by @icanhazstring in #1753 (comment)
Also, see #1753 (comment)
The text was updated successfully, but these errors were encountered: