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
A candidate or saved test input that maps objects of type K to bytes.
-
Constructor Summary
ConstructorsConstructorDescriptionInput()Create an empty input.Input(ZestGuidance.Input toClone) Create a copy of an existing input. -
Method Summary
Modifier and TypeMethodDescriptionabstract ZestGuidance.Inputabstract voidgc()abstract intgetOrGenerateFresh(K key, Random random) booleanReturns whether this input should be favored for fuzzing.static intsampleGeometric(Random random, double mean) Sample from a geometric distribution with given mean.voidSets this input to be favored for fuzzing.abstract intsize()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Constructor Details
-
Input
public Input()Create an empty input. -
Input
Create a copy of an existing input.- Parameters:
toClone- the input map to clone
-
-
Method Details
-
getOrGenerateFresh
-
size
public abstract int size() -
fuzz
-
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
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
-