All about vertices
A finite-state machine is
described in a model, or if you
will, a graph. (See also graphs
in Wikipedia) The vertices are the states or nodes in that
model (graph).
A vertex is a test oracle, which
function is to verify the reached state during test execution. In the
test execution tool, the method representing the vertex, should have
code that tries to verify the expected state.
For example: Let's assume
that we have a vertex called v_BaseURL,
and the state that is expected, is the base url of www.amazon.com. If
we would implement code that would try to verify that state, and if we
would use java and the Selenium
Remote Control package, the code could look like this:
/**
* This method implements the Vertex 'v_BaseURL'
*/
public void v_BaseURL()
{
log.info( "Vertex: v_BaseURL" );
browser.waitForPageToLoad( "10000" );
assertEquals( "Amazon.com: Online Shopping for Electronics, Apparel, Computers, Books, DVDs & more", browser.getTitle() );
}
In the example above, the browser variable, is
an instance of com.thoughtworks.selenium.Selenium.
In org.tigris.mbt
following rules aplies when modelling the graph.
Common rules
A vertex must
always have a label. The label
of a vertex is used to find the
correct test method, function or sub routine during test exection. It's
very important to
follow the name conventions of your test exectuion tool. White spaces
are not allowed.
As a rule of thumb, the best practice is to start the name
with 'v_'. The reason for this, is that it is easier to recognize the
function in the test execution tool, as a vertex.
For exampel:
v_ApplicationStarted
v_BasicView
The same name of a vertex, can be re-used in the model.