basic_mutator
basic_mutator copied to clipboard
Reduce code duplication for mutation strategies that have overwrite and insert modes
Some of our mutation strategies have both an insert and overwrite mode. Currently we split the logic into two. These could be combined into one function and reduce some code duplication.
It's a bit non-trivial as insertions can append to the input, or insert to an empty input, where overwrites can only overwrite valid parts of an existing input. Further, things like inserts must check for situations which would expand the input past the maximum input size, where for overwrites, the bounds must be checked of the region to overwrite.