TestOptimal Wiki

Model-Based Testing (MBT)

User Tools

Site Tools


Transition/Edge Property

»Model Editor Transition Context Menu: Trans Property

A transition/edge represents a path from one state/node to another. In web application model this usually represents a click on an anchor link, a button or a map. Transition/Edge properties can be viewed and edited in this Transition Property dialog accessed through transition's context menu.


Property Definition

  • Event ID - required, a unique identifier you assign to this transition. It should not contain any spaces, dash “-” or any characters that are not valid to be used in naming the java methods.
  • Target State - required, dropdown list of all states. Select the next state this transition will take the application to.
  • Description - a freetext description to document what this transition is about and what it does.
  • Tags - requirements id or any identifier for requirements traceability. Multiple tags are allowed separate by semi-colon.
  • Assert ID - a unique id to used to raise the defect in ALM when the transition fails, requires ALM plugin and ALM configuration.
  • Color - optionally you can set a color for this transition. The transition is depicted with an arrow going from one state to another.
  • Weight - dropdown list of weights you can assign to this transition to enfluence the probability this transition is chosen by RandomSequencer and GreedySequencer.
  • Traverses Required - minimum number of times this transitions must be traversed. Usually this is set to 1, but you can assigne any number greater than 1 to force testing this transition multiple times or 0 if the coverage on this transition is optional.
  • Guard - specify a condition which must evaluate to true before the transition can be executed. (Rel 3.0.22)
  • Set Var - sets a var to the specified value when the transition is traversed. (Rel 3.0.22)
  • Guard Hint - used to aid sequencer to find the transition to resolve the current transition's guard failure. (Rel. 4.4.7)
  • Satisfying Hint - used to aid sequencer to identify the transition to help resolve a transition guard failure. (Rel. 4.4.7)
  • Response Max (ms) - maximum number of milliseconds when exceeded to add the traversal of this transition to the slow performance tally.
  • Action Delay (ms) - number of milliseconds to delay after Action trigger is executed. This is used to slow down the testing if your application is experiencing the performance at this particular transition. This setting overrides the setting mbt node.

Click on the button “Save” to save the changes.

Guard Conditions

Guard conditions are used to selectively turning on and off a transition based on mScript expression which evaluates to true or false (see mScriptFunc).

Guard condition is specified with an mscript expression. Typically you would use any of the boolean operation mscript functions, e.g. $compare(), $isTrue().

You may nest the mscript function calls.

For example,

   $compare('$getTitle()','eq','$getData('$getVar('dsName')')')', 'expectedTitle')

or more complex expression like:

   $and('$isFalse('$compare('$getTitle','contains','loginID')')', '$getVar('abc')')

With Rel. 3.2 (new), you may use Guard trigger for multiple and complex guard conditions.

Guard Hint / Satisfying Hint

When traversing the model, sequencers must deal with the transitions/edges that fail due to guard conditions. All sequencer are designed to automatically resolve the guard failures by finding an alternate path. Most of the time this is sufficient. From time to time the sequencer may need some hints to resolve the guard failure or find better path to resolve a particular guard failure.

Hint is a code or series of codes assigned to transitions/edges.

  • Guard Hint - hint used to find transition/edge with matching Satisfying Hint
  • Satisfying Hint - hint used to determine if the transition/edge can be used to resolve the failed guard of a transition/edge.

Hint may be shared by multiple transitions/edges. For example a set of transitions/edges may require user to be logged in. It's obvious that in order to perform the login, you can just traverse the login transition (State Diagram) or edge that leads to the login process (Activity Diagram). Since computer doesn't know that, we need a mechanism to bridge the transition/edge that requires the login and the transition that performs the login. And we do so by assigning the designated hint to both transitions/edges.

If multiple hints are assigned (separated by comma), any of the hints will be sufficient to satisfy the demanding transition/edge.

Set Var

Set var is triggered when the transition is traversed and the variable specified is automatically set to the value evaluated from the expression specified in “Set Var” field. This is just is equivalent to calling the mscript function $setVar('varName','varValue') in any of the transition triggers.

Set Var takes the following format:

   varName: value

Both varName and value must be static value and can not be an expression. You can also set the variable using the mScript function setVar('varName','varValue) which allows both varName and varValue to be specified in mScript expression.

transnode.txt · Last modified: 2017/12/21 04:44 by admin