-
-
Notifications
You must be signed in to change notification settings - Fork 153
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
Remove generic mutation to self
#1210
Conversation
dgollahon
commented
Jan 16, 2021
•
edited
Loading
edited
- This rarely yields an alive mutation and, when it does, it can sometimes be frustrating to avoid or work around. It is also probably a bit confusing to newcomers. Removing this should also make mutant runs shorter since it is a frequently generated mutation.
4eaee10
to
9113c33
Compare
def emit_explicit_self | ||
return if UNARY_METHOD_OPERATORS.include?(selector) | ||
|
||
emit_receiver(N_SELF) unless n_nil?(receiver) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mbj I added this and this to keep the change in behavior a bit more narrow since it may be useful to change foo.bar.baz
to self.baz
.
That said, we could also just emit implicit self in more cases and not generate this most of the time if we wanted. There are only a few cases where the explicit self is necessary or preferred self.foo = 1
, etc.
If we emitted the implicit self directly instead of explicit, that would probably be nice for cases where mutant emits self.baz
and you have to run it again to see that actually you could have just done baz
. I have a WIP commit that does something like this that I can show you (I may just push it to this branch).
91e2a58
to
e0fb2b0
Compare
@dgollahon feel free to merge past rebase. |
b3330c7
to
7da06f6
Compare
Fun fact: on |
- This rarely yields an alive mutation and, when it does, it can sometimes be frustrating to avoid or work around. It is also probably a bit confusing to newcomers. Removing this should also make mutant runs shorter since it is a frequently generated mutation.
7da06f6
to
39573e8
Compare
@dgollahon In astronomy there is the concept of a Standard Candle. An event of known magnitude that can serve as a reference in an otherwise very relative observation space with too many variables. As the standard candle event does not "change" lots of astrophysics measurements are first made possible. Unlike corpus tests where both the implementation and the content of the corpus can change, currently Also the test suite is fully covering mutant both for rspec and minitest. Its a very good "non moving" optimization target. |
Yeah, I think it is a very cool reference point. The Standard Candle comparison is a good one. |