A finite-state machine is described in a model, or if you will, a graph. (See also graphs in Wikipedia) The edges are the lines, arrows, that combine two states (vertices, nodes).
An edge describes a possible path that leads from one state, into another.
In mbt following rules applies when modeling the graph.
Common rules
An edge can have a label, but it is not mandatory. The label of an edge is used to find the correct test method, function or sub routine during test execution. It's very important to follow the name conventions of your test execution tool. White spaces are not allowed.
As a rule of thumb, the best practice is to start the name with 'e_'. The reason for this, is that it is easier to recognize the function in the test execution tool, as an edge. For exampel:
e_StartApplication e_EnterBasicView
The same name of an edge, can be re-used in the model.
Label format for finite-state machines, FSM
An edge can have a label, but it is not mandatory.
Label Keyword
The fig below shows some examples of FSM labels.
An example showing different types of FSM labels
Label format for finite-state machines, EFSM
An ESFM edge can have a label, but it is not mandatory. Also, it can have Parameter, Guard, Actions and Keywords.
Label Parameter [Guard] / Action1;Action2;ActionN; Keyword
An example showing different types of EFSM labels
Keywords
The keywords are written on separate lines on the labels of vertices and edges. The exception of that rule is START and STOP, which are written on the first line.
Example
e_CloseApp_AltF4 BACKTRACK weight=0.1
Keyword - MERGE
Used by Vertices only, can be combined with other keywords
This datum is used by MBT when merging graphs. It tells MBT that the vertex containing this key word, should be merged with the first occurence of a vertex with the same label.
Example
v_MainForm MERGE
Keyword - NO_MERGE
Used by Vertices only, can be combined with other keywords
This datum is used by MBT when merging graphs. It tells MBT that the vertex containing this key word, should not merge this vertex with any subgraph.
Example
v_MainForm NO_MERGE
Keyword - BACKTRACK
Used by Edges only in FSM (not for use in EFSM), can be combined with other keywords
An edge with the key word BACKTRACK is used to enable a simple logic that enables a end user to backtrack in the graph to the previous vertex. This is used only during a dynamic run.
Example
e_ClickOKButton BACKTRACK
Keyword - BLOCKED
Used by Vertices and Edges, can be combined with other keywords
A vertex or an edge with the key word BLOCKED, will not participate in the resulting (merged) graph, end thus be excluded.
Example 1
v_MainForm BLOCKED
Example 2
e_MenuFileExit BLOCKED
Keyword - START
Used by Vertices only, can not be combined with other keywords
Each graph has a start (entry) vertex, and that vertex holds this datum. There is only one vertex in a graph, holding this datum. Used by MBT when merging graphs, and when generating test sequences.
Example
START
Keyword - STOP
Used by Vertices only, can not be combined with other keywords
The stop (exit) vertex denotes an exit point in a graph. There can only be one vertex in a graph, holding this datum. Only sub-graphs can have a stop vertex. Used by MBT only when merging graphs.
Example
STOP
Keyword - weight
Used by Edges only, can be combined with other keywords
Used by MBT during random walks during test sequence generation. It holds a real value between 0 and 1, and represents the probability that a specific edge should be chosen. A value of 0.05, would mean a 5% chance of that edge to be selected during a run.
Example
e_GoAdmin weight=0.05

