Package edu.berkeley.cs.jqf.fuzz.ei
Class ZestGuidance.Input<K>
- java.lang.Object
-
- edu.berkeley.cs.jqf.fuzz.ei.ZestGuidance.Input<K>
-
- 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 Summary
Constructors Constructor Description Input()
Create an empty input.Input(ZestGuidance.Input toClone)
Create a copy of an existing input.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract ZestGuidance.Input
fuzz(Random random)
abstract void
gc()
abstract int
getOrGenerateFresh(K key, Random random)
boolean
isFavored()
Returns whether this input should be favored for fuzzing.static int
sampleGeometric(Random random, double mean)
Sample from a geometric distribution with given mean.void
setFavored()
Sets this input to be favored for fuzzing.abstract int
size()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Constructor Detail
-
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 Detail
-
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 generatormean
- the mean of the distribution- Returns:
- a randomly sampled value
-
-