|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnz.ac.waikato.modeljunit.AbstractListener
nz.ac.waikato.modeljunit.coverage.AbstractCoverage
nz.ac.waikato.modeljunit.coverage.StateCoverage
public class StateCoverage
Counts the number of times each state has been entered. Each reset will increment the count of the initial state. Each transition will increment the count of its target state.
The getCoverage method will return the total number of states visited since the last clear. The getMaximum method will return the total number of states in the graph, if this is known.
Field Summary | |
---|---|
protected boolean |
todoReset_
|
Fields inherited from class nz.ac.waikato.modeljunit.coverage.AbstractCoverage |
---|
coverage_, currCoverage_, maxCoverage_ |
Fields inherited from class nz.ac.waikato.modeljunit.AbstractListener |
---|
model_ |
Constructor Summary | |
---|---|
StateCoverage()
|
Method Summary | |
---|---|
void |
clear()
Reset all coverage data. |
void |
doneReset(java.lang.String reason,
boolean testing)
Increments the count of the initial state. |
void |
doneTransition(int action,
Transition tr)
Increments the count of the target state of the transition. |
java.lang.String |
getDescription()
A medium-length description of this coverage metric. |
java.lang.String |
getName()
Get the short name that this listener is known by. |
void |
setGraph(InspectableGraph model,
java.util.Map<java.lang.Object,Vertex> state2vertex)
A default implementation that does nothing. |
Methods inherited from class nz.ac.waikato.modeljunit.coverage.AbstractCoverage |
---|
addItem, getCoverage, getDetails, getMaximum, getPercentage, incrementItem, toString, transition |
Methods inherited from class nz.ac.waikato.modeljunit.AbstractListener |
---|
doneGuard, failure, getModel, setModel, startAction |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface nz.ac.waikato.modeljunit.ModelListener |
---|
doneGuard, failure, getModel, setModel, startAction |
Field Detail |
---|
protected boolean todoReset_
Constructor Detail |
---|
public StateCoverage()
Method Detail |
---|
public java.lang.String getName()
ModelListener
public java.lang.String getDescription()
CoverageMetric
public void setGraph(InspectableGraph model, java.util.Map<java.lang.Object,Vertex> state2vertex)
AbstractCoverage
setGraph
in interface CoverageMetric
setGraph
in class AbstractCoverage
public void clear()
AbstractCoverage
The default implementation iterates through the coverage_ map and resets all counts to zero, and also resets currCoverage_ to zero, to maintain the invariant.
clear
in interface CoverageMetric
clear
in class AbstractCoverage
public void doneReset(java.lang.String reason, boolean testing)
doneReset
in interface ModelListener
doneReset
in class AbstractCoverage
reason
- An adjective that describe why the reset was done.testing
- The parameter that was passed to the FsmModel reset call.public void doneTransition(int action, Transition tr)
doneTransition
in interface ModelListener
doneTransition
in class AbstractListener
action
- The number of the action just taken.tr
- The transition just taken.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |