-
Notifications
You must be signed in to change notification settings - Fork 27
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
R argument switching mutants are equivalent #26
Comments
@debsourav33 @kjain14 you guys are the rule hacking experts now; is this hard? It'd actually be better for Python too, since swapping named args is always equivalent |
Shouldn't be very hard to achieve.. Just need to find a clever way to skip the arguments with '=' in it.. I will try updating the rules and make a PR |
perhaps an alternative to turning it off would be switching values or names in two named arguments fun(x=1, y=2)
fun(x=2, y=1) etc |
Addressed both issues (skip swapping named arguments and swap their values/names instead) in the PR #27 |
Closed via #27 |
yay thanks |
@tdhock not on pip yet, though, note |
(on pip now) |
hi @agroce
I'm trying to make PRs based on the R data.table mutants Rdatatable/data.table#6114
And I noticed that many of the mutants involve switching the order of arguments, here are two examples.
setops.R:8 by.y becomes cols in either case.
transpose.R:63 type.convert becomes x in either case.
All of these argument switching mutants in R code are equivalent, because R first matches the named arguments, then assigns the positional arguments.
For future mutation testing of R code, it would be useful to avoid generating such mutants, perhaps by adding a rule that if the argument to switch has an equals sign (name=value, so it is a named argument), then do not try switching.
The text was updated successfully, but these errors were encountered: