-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add !
mutation to INVERT_LOGICAL
#145
Comments
!
mutation to INVERT_LOGICAL (TBD after #137)!
mutation to INVERT_LOGICAL
Let me share some thoughts. They are not well structured yet, but anyway. At the moment we have only token Mutant -- the mutant that changes token of the ast.Node. To change the expression (and that is actually what we want for the ! -> !! case) we might want another Mutant, let's call it expression Mutant. The main difference would be Apply method. Rather than replace token with another one, the expression Mutant would apply some function to the expression of a unary operator or to both expressions (separately for X and for Y, and maybe for both X and Y together) of a binary operator. For ! -> !! case, it's quite obvious that we need to find NOT node and change its expression so that
By the way, it might also be useful, to apply that mutation to binary logical expression, so that we would test not qust |
Yes, the idea is to write another Mutant. My concern is to keep out from the Mutator as much mutant logic as possible. Ideally we should be able to implement a new Mutant without even touching Mutator.
I foresee a major refactoring of the relationship Mutant/Mutator, but I believe it is necessary and will open the doors to a lot of possibility on mutations. |
To be done after #137
Add
!
->!!
toINVERT_LOGICAL
.This is a little more challenging than the basic token mutations because Gremlins' mutator engine still doesn't support this kind of mutation where tokens are not simply swapped. In this case we have to wrap a unary operator into another unary operator.
The text was updated successfully, but these errors were encountered: