|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectAbstractGenerator
public abstract class AbstractGenerator extends Object
Algorithm template for implementing a test generator.
The main generation loop is defined in method explore(),
which repeatedly generates a new sequence, determines if it a failing
sequence, and stops the process when the time or sequence limit expires.
The process of generating a new sequences is left abstract.
ForwardGenerator| Modifier and Type | Field and Description |
|---|---|
ComponentManager |
componentManager
Component manager responsible for storing previously-generated sequences. |
static Sequence |
currSeq
This field is set by Randoop to point to the sequence currently being executed. |
static boolean |
dump_sequences
|
MultiVisitor |
executionVisitor
Container for execution visitors used during execution of sequences. |
RandoopListenerManager |
listenerMgr
Manages notifications for listeners. |
int |
maxSequences
Sequence limit for generation. |
long |
maxTimeMillis
Time limit for generation. |
int |
num_failing_sequences
|
int |
num_sequences_generated
|
int |
num_steps
|
List<ITestFilter> |
outputTestFilters
A list of filters that can be installed to help determine if a sequence should be added to the final sequence list outSeqs. |
List<ExecutableSequence> |
outSeqs
The list of final sequences that are printed out as JUnit tests (i.e. |
List<StatementKind> |
statements
The list of statement kinds (methods, constructors, primitive value declarations, etc.) used to generate sequences. |
Timer |
timer
The timer used to determine how much time has elapsed since the start of generator and whether generation should stop. |
| Constructor and Description |
|---|
AbstractGenerator(List<StatementKind> statements,
long timeMillis,
int maxSequences,
ComponentManager componentManager,
IStopper stopper,
RandoopListenerManager listenerManager,
List<ITestFilter> testfilters)
Constructs a generator with the given parameters. |
| Modifier and Type | Method and Description |
|---|---|
void |
explore()
Creates and executes new sequences in a loop. |
abstract int |
numSequences()
|
abstract ExecutableSequence |
step()
|
protected boolean |
stop()
|
Set<Sequence> |
subsumed_sequences()
Returns the set of sequences that are used as inputs in other sequences (and can thus be thought of as subsumed by another sequence). |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static boolean dump_sequences
public int num_steps
public int num_sequences_generated
public int num_failing_sequences
public final Timer timer
public final long maxTimeMillis
public final int maxSequences
public List<StatementKind> statements
public final MultiVisitor executionVisitor
public ComponentManager componentManager
public RandoopListenerManager listenerMgr
IEventListenerpublic static Sequence currSeq
public List<ExecutableSequence> outSeqs
public List<ITestFilter> outputTestFilters
| Constructor Detail |
|---|
public AbstractGenerator(List<StatementKind> statements,
long timeMillis,
int maxSequences,
ComponentManager componentManager,
IStopper stopper,
RandoopListenerManager listenerManager,
List<ITestFilter> testfilters)
statements - Statements (e.g. methods and constructors) used to create sequences. Cannot be null.timeMillis - maximum time to spend in generation. Must be non-negative.maxSequences - maximum number of sequences to generate. Must be non-negative.componentManager - component manager to use to store sequences during component-based generation.
Can be null, in which case the generator's component manager is initialized as new ComponentManager().stopper - Optional, additional stopping criterion for the generator. Can be null.listenerManager - Manager that stores and calls any listeners to use during generation. Can be null.testfilters - List of filters to determine which sequences to output. Can be null or empty.| Method Detail |
|---|
protected boolean stop()
public abstract ExecutableSequence step()
public abstract int numSequences()
public void explore()
public Set<Sequence> subsumed_sequences()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||