net.sourceforge.groboutils.mbtf.v1
The Model-Based Testing Framework. Currently, the MBTF is a simple
state machine engine that is able to generate cyclic paths through the various
transitions presented by the state machine model, combined with a Path Parser
that knows the correct procedure in iterating though a path, and executing the
correct validation steps.
Implementation
Model-Based Testing allows for testing the various routes of computation
though a system to ensure system integrity. Traditional testing methodologies
requires the tester to calculate and manually generate these paths.
The logic goes something like this: the tester models the system in a
state-machine, using a minimalistic model where possible. At each state, the
tester creates validation tests to ensure the system is indeed in that state.
Also, each state has an associated set of transitions; each transition has
both a validation (to ensure the transition can occur), and an action which
moves the current state to another state. The MBTF then takes this model and
generates combinations of paths through the states. At each state, the state
itself is verified, and all transitions are verified. Any error discovered
causes the path to be recorded and stamped with the error for future
evaluation.
Useage
A direct user of the MBTF needs to first define an implementation of
ISystem. This class contains the necessary information and
actions to perform state validation and transition actions for the system
in question. Also, the user needs to define an ISystemFactory, which
knows how to create an ISystem in the correct initial state.
I'd recommend for your particular System, creating an abstract
IVerifiy implementation which allows for reducing the casting problem
inherit in a generic system such as this:
public abstract class MyVerify implements IVerify
{
public final void verify( ISystem ss, IErrors errors )
{
myVerify( (MySystem)ss, errors );
}
public abstract void myVerify( MySystem mss, IErrors errors );
}
Then, it's a matter of defining the system's set of states and transitions.
References
|