Login | Register
My pages Projects Community openCollabNet

mbt
Wiki: All about generators

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

 

A generator is an algorithm that decides how to traverse a model. Different generators will generate different test sequences, and they will navigate in different ways.

RANDOM

Navigate through the model in a completely random manor. Also called "Drunkard’s walk", or "Random walk".

The algorithm selects an out-edge from a vertex by random, and repeats the process in the next vertex.

A_STAR

Will try to generate the shortest possible test sequence through a model. This is very good when trying to find the fastest path with complete coverage in a model. The downside is that it only works on smaller models. If used on large models, mbt will take a lot of CPU time, computing the shortest path. See Wikipedia article: A* search algorithm

SHORTEST_NON_OPTIMIZED

This is a compromise between A_STAR and RANDOM. The algorithm works as follows:

  1. Choose an edge not yet visited by random.
  2. Select the shortest path to that edge using Dijkstra's algorithm (See Wikipedia: Dijkstra's algorithm)
  3. Walk that path, and mark all those edges as visited.
  4. When reaching the selected edge in step 1, start all over, repeating steps 1->4.

Pros: The algorithm works well an very large models, and generates reasonably short sequences.
Cons: When used in a Extended FSM, it is quite possible to end up in a situation, where the only edges left to choose from, are protected by guards. This means that MBT enters an internal infinite loop. Also, be sure to have a rolling log file. Or else, your file system will be all filled up. (Below is an example how log4j should be configured. This is deafult in mbt.properties)

log4j.appender.LOG=org.apache.log4j.RollingFileAppender 
log4j.appender.LOG.File=logs/mbt.log
log4j.appender.LOG.MaxFileSize=20MB
log4j.appender.LOG.MaxBackupIndex=5


LIST

Generates a list of all edges and vertices in a graph. If the label of a vertex or an edge occurs more than once in the model, it will only be printed once.

See also How to list all unique labels in a graph.

STUB

Generates source code, with the use of templates.

See also How to generate source code from a model.

REQUIREMENTS

Generates a list of all requirements found in a model.

See also How to generate list of requirements from a model.

All about generators (last edited 2009-11-08 09:24:15 -0800 by ?kristiankarl)