Class ZestGuidance.Input<K>

java.lang.Object
edu.berkeley.cs.jqf.fuzz.ei.ZestGuidance.Input<K>
All Implemented Interfaces:
Iterable<Integer>
Direct Known Subclasses:
ExecutionIndexingGuidance.MappedInput, ZestGuidance.LinearInput
Enclosing class:
ZestGuidance

public abstract static class ZestGuidance.Input<K> extends Object implements Iterable<Integer>
A candidate or saved test input that maps objects of type K to bytes.
  • Constructor Details

    • Input

      public Input()
      Create an empty input.
    • Input

      public Input(ZestGuidance.Input toClone)
      Create a copy of an existing input.
      Parameters:
      toClone - the input map to clone
  • Method Details

    • getOrGenerateFresh

      public abstract int getOrGenerateFresh(K key, Random random)
    • size

      public abstract int size()
    • fuzz

      public abstract ZestGuidance.Input fuzz(Random random)
    • gc

      public abstract void gc()
    • setFavored

      public void setFavored()
      Sets this input to be favored for fuzzing.
    • isFavored

      public boolean isFavored()
      Returns whether this input should be favored for fuzzing.

      An input is favored if it is responsible for covering at least one branch.

      Returns:
      whether or not this input is favored
    • sampleGeometric

      public static int sampleGeometric(Random random, double mean)
      Sample from a geometric distribution with given mean. Utility method used in implementing mutation operations.
      Parameters:
      random - a pseudo-random number generator
      mean - the mean of the distribution
      Returns:
      a randomly sampled value