nz.ac.waikato.modeljunit
Class GreedyTester

java.lang.Object
  extended by nz.ac.waikato.modeljunit.Tester
      extended by nz.ac.waikato.modeljunit.RandomTester
          extended by nz.ac.waikato.modeljunit.GreedyTester

public class GreedyTester
extends RandomTester

Test a system by making greedy walks through an EFSM model of the system. A greedy random walk gives preference to transitions that have never been taken before. Once all transitions out of a state have been taken, it behaves the same as a random walk.

Author:
Pele Douangsavanh

Field Summary
protected  GraphListener graph_
           
 
Fields inherited from class nz.ac.waikato.modeljunit.RandomTester
DEFAULT_RESET_PROBABILITY
 
Fields inherited from class nz.ac.waikato.modeljunit.Tester
FIXEDSEED, model_, rand_
 
Constructor Summary
GreedyTester(FsmModel fsm)
          A convenience constructor that puts a Model wrapper around an FsmModel.
GreedyTester(Model model)
          Creates a test generator that can generate random walks.
 
Method Summary
protected  int doGreedyRandomAction()
           
 int doGreedyRandomActionOrReset()
           
 int generate()
          Generates one step of a random walk through the model.
 java.lang.String getDescription()
          A brief description of this test generation algorithm.
 java.lang.String getName()
          The name of this test generation algorithm.
 
Methods inherited from class nz.ac.waikato.modeljunit.RandomTester
doRandomAction, doRandomActionOrReset, getResetProbability, setResetProbability
 
Methods inherited from class nz.ac.waikato.modeljunit.Tester
addCoverageMetric, addListener, addListener, addListener, buildGraph, buildGraph, buildGraph, buildGraphBreadthFirst, generate, getModel, getRandom, printCoverage, reset, setRandom
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

graph_

protected GraphListener graph_
Constructor Detail

GreedyTester

public GreedyTester(Model model)
Creates a test generator that can generate random walks.

Parameters:
model - Must be non-null;

GreedyTester

public GreedyTester(FsmModel fsm)
A convenience constructor that puts a Model wrapper around an FsmModel.

Parameters:
fsm - Must be non-null.
Method Detail

getName

public java.lang.String getName()
Description copied from class: Tester
The name of this test generation algorithm.

Overrides:
getName in class RandomTester

getDescription

public java.lang.String getDescription()
Description copied from class: Tester
A brief description of this test generation algorithm.

Overrides:
getDescription in class RandomTester

doGreedyRandomAction

protected int doGreedyRandomAction()

doGreedyRandomActionOrReset

public int doGreedyRandomActionOrReset()

generate

public int generate()
Description copied from class: RandomTester
Generates one step of a random walk through the model. This calls RandomTester.doRandomActionOrReset().

Overrides:
generate in class RandomTester
Returns:
the number of the action taken, or -1 if a reset was done.


Copyright © 2009 ModelJUnit Project. All Rights Reserved.