|
JET | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.utep.cs.et.rat.gen.ClassValueGenerator
edu.utep.cs.et.rat.gen.IncrementalClassValueGenerator
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 | |
|---|---|
private static Map<Class,List<Denotable>> |
pool
Object pool, a map from classes to lists of denotables. |
| Fields inherited from class edu.utep.cs.et.rat.gen.ClassValueGenerator |
|---|
context, type |
| Constructor Summary | |
|---|---|
IncrementalClassValueGenerator(ValueFactory factory,
ValueGenerator generator)
Creates a class generator that uses the given value factory and generator. |
|
| Method Summary | |
|---|---|
private void |
addPooled(Class clazz,
Denotable value)
Adds the given object of the given type to the pool. |
private boolean |
canConstruct(Denotable value)
Returns true if the given value can actually be built. |
private Denotable |
choosePooled(Class clazz)
Chooses from the pooled objects an arbitrary object of the given type. |
protected Denotable |
construct(int maxHeight)
Constructs an instance of the target class. |
private boolean |
hasPooled(Class clazz)
Returns true if at least one object of the given type is pooled. |
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.et.rat.gen.ClassValueGenerator |
|---|
createNullValue, generate |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final Map<Class,List<Denotable>> pool
| Constructor Detail |
|---|
public IncrementalClassValueGenerator(ValueFactory factory,
ValueGenerator generator)
| Method Detail |
|---|
protected Denotable construct(int maxHeight)
construct in class ClassValueGeneratormaxHeight - Maximum height of the constructed objectprivate boolean canConstruct(Denotable value)
protected Denotable mutate(Denotable value,
double rate,
boolean mutated,
int maxHeight)
mutate in class ClassValueGeneratorvalue - Object to be mutatedrate - Mutation ratemutate - 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 ClassValueGeneratorprivate boolean hasPooled(Class clazz)
private Denotable choosePooled(Class clazz)
private void addPooled(Class clazz,
Denotable value)
|
JET | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||