-
Notifications
You must be signed in to change notification settings - Fork 3
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
Selective mutation instrumentation #218
base: main
Are you sure you want to change the base?
Conversation
One issue that will have to be overcome here is avoiding writing to the source file if the mutation trees differ. Currently the mutation tree is built and checked as the mutations are applied. If at some point in this process, we find the two trees differ, we wish to throw and error and tell the user that they must be the same. However, because mutations are applied as the tree is built, the source file would have already been modified at this point. |
This is currently implemented in such a way that each 'MutationGroup' can be enabled or disabled and thus that all possible mutants for a source location will either be included or excluded. It may be the case that we would like more fine grained control than this but this becomes much more difficult as one function is used for replacing an entire class of mutants. Therefore, this would either require many more replacement functions, or a change how we currently instrument. |
My initial idea was to make each mutation function take in a Another option is to create a new mutation function for each possible combination of enabled mutants that we encounter. This will lead to huge code bloat but will in turn mean that there should be no extra runtime overhead over the approach that we already use since the functions will be inlined. However, this goes against Dredd's design decision to have a single function for each mutant category. |
Allow a subset of possible mutants to be instrumented by first performing a pass to collect the possible mutants into a .json, selecting which should be enabled, and then performing a second pass to instrument them.