Package edu.berkeley.cs.jqf.fuzz.random
Class NoGuidance
java.lang.Object
edu.berkeley.cs.jqf.fuzz.random.NoGuidance
- All Implemented Interfaces:
Guidance
- Direct Known Subclasses:
DiffFuzzNoGuidance
A front-end that only generates random inputs.
This class provides no guidance to quickcheck. It seeds random values from
Random, making it effectively an unguided random test input
generator.
-
Constructor Summary
ConstructorsConstructorDescriptionNoGuidance(long maxTrials, PrintStream out) Creates a NoGuidance instance that will run a maximum number of trials. -
Method Summary
Modifier and TypeMethodDescriptiongenerateCallBack(Thread thread) Returns a callback that does almost nothing.Returns a reference to the coverage statistics.getInput()Returns a stream of random numbersvoidhandleResult(Result result, Throwable error) Handles the result of a fuzz run.booleanhasInput()Returnstrueas long asmaxTrialshas not been reached.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.berkeley.cs.jqf.fuzz.guidance.Guidance
beforeRun, observeGeneratedArgs, observeGuidance
-
Constructor Details
-
NoGuidance
Creates a NoGuidance instance that will run a maximum number of trials.- Parameters:
maxTrials- the maximum number of runs to executeout- an optional stream for logging error traces
-
-
Method Details
-
getInput
Returns a stream of random numbers -
hasInput
public boolean hasInput()Returnstrueas long asmaxTrialshas not been reached. -
handleResult
Handles the result of a fuzz run.- Specified by:
handleResultin interfaceGuidance- Parameters:
result- the result of the fuzzing trialerror- the error thrown during the trial, ornull
-
generateCallBack
Returns a callback that does almost nothing.Since this is unguided random guidance, the trace events are not used in generating inputs.
The handler here merely updates coverage statistics.
- Specified by:
generateCallBackin interfaceGuidance- Parameters:
thread- the thread whose events to handle- Returns:
- a callback that does nothing.
-
getCoverage
Returns a reference to the coverage statistics.- Returns:
- a reference to the coverage statistics
-