|
JET | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.utep.cs.jet.rat.gen.ClassValueGenerator
edu.utep.cs.jet.rat.gen.IncrementalClassValueGenerator
public class IncrementalClassValueGenerator
A class to generate class values incrementally. This class uses an incremental random approach in that every method or constructor, selected randomly, is checked on-the-fly to ensure a successful invocation of the method or constructor, i.e., no exception and no assertion violation.
| Field Summary |
|---|
| Fields inherited from class edu.utep.cs.jet.rat.gen.ClassValueGenerator |
|---|
context, factory, mutators, type |
| Constructor Summary | |
|---|---|
IncrementalClassValueGenerator(ValueFactory factory,
ValueGenerator generator)
Creates a class generator that uses the given value factory and generator. |
|
| Method Summary | |
|---|---|
protected boolean |
canConstruct(Denotable value)
Returns true if the given value can actually be built. |
protected Denotable |
construct(int maxHeight)
Constructs an instance of the target class. |
Denotable |
generate(Class<?> type,
Context ctx,
int maxHeight)
Generates a value of the given class type under the given testing context. |
protected Denotable |
mutate(Denotable value,
double rate,
boolean mutated,
int maxHeight)
Mutates the given value by calling a sequence of mutators. |
protected void |
reset(Class<?> type,
Context ctx)
Reconfigures this object to be able to create an object of the given type in the given testing context. |
| Methods inherited from class edu.utep.cs.jet.rat.gen.ClassValueGenerator |
|---|
createNullValue, generateArguments, simpleMutate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IncrementalClassValueGenerator(ValueFactory factory,
ValueGenerator generator)
| Method Detail |
|---|
public Denotable generate(Class<?> type,
Context ctx,
int maxHeight)
maxHeight to prevent
an infinite or excessive recursion. This method is overriden hehre
to implement object pooling.
generate in class ClassValueGeneratorprotected Denotable construct(int maxHeight)
construct in class ClassValueGeneratormaxHeight - Maximum height of the constructed objectprotected boolean canConstruct(Denotable value)
protected Denotable mutate(Denotable value,
double rate,
boolean mutated,
int maxHeight)
mutate in class ClassValueGeneratorvalue - Object to be mutatedrate - Mutation ratemutated - True if the object has already been mutatedmaxHeight - Maximum height of the mutated object (viewed
as a tree)
protected void reset(Class<?> type,
Context ctx)
reset in class ClassValueGenerator
|
JET | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||