Login | Register
My pages Projects Community openCollabNet

mbt
Wiki: All about vertices

Edit this page | Links to this page | Page information | Attachments | Refresh page

 

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:

   1     /**
   2      * This method implements the Vertex 'v_BaseURL'
   3      */
   4     public void v_BaseURL()
   5     {
   6       log.info( "Vertex: v_BaseURL" );
   7       browser.waitForPageToLoad( "10000" );
   8       assertEquals( "Amazon.com: Online Shopping for Electronics, Apparel, Computers, Books, DVDs & more", browser.getTitle() );
   9     }

In the example above, the browser variable, is an instance of [com.thoughtworks.selenium.Selenium http://release.openqa.org/selenium-remote-control/0.9.0/doc/java/].

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 example:

 v_ApplicationStarted
 v_BasicView

The same name of a vertex, can be re-used in the model.

All about vertices (last edited 2009-09-20 13:02:05 -0700 by ?kristiankarl)