Skip to content

Code quality improvements for fuzzing/valuegeneration #809

Description

@samalws-tob
  • It's a bit clunky to have RandomValueGenerator implement ValueMutator, since that's not its purpose. Right now all its Mutate functions are dummy functions that return the input. Do we need to implement this at all; can we just remove these methods?
  • It's a bit clunky to have MutationalValueGenerator implement ValueGenerator, since that's not its purpose. Right now its Generate methods call mutate on a blank value, basically just repeating the work of RandomValueGenerator. Do we need to implement this at all? Can we just remove these methods and use RandomValueGenerator instead?
  • EncodeJSONArgumentsToMap, EncodeJSONArgumentsToSlice, EncodeABIArgumentsToString, and so on should probably be somewhere else
  • MutationalValueGenerator.MutateArray does nothing and has a big TODO in it: TODO: Apply array structure mutations (swap, insert, delete)
  • I think the parentheses here are wrong: mutationCount := g.randomProvider.Intn(((g.config.MaxMutationRounds - g.config.MinMutationRounds) + 1) + g.config.MinMutationRounds)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions