You are here

Ending a test in Model Based Testing with GraphWalker

When modeling is might not always be the best implementation of the model to force all the test to end in the same state. (But is it more manageable to model with this thought in mind.)
Sometime the test need to stop when a specific condition arises.
A stop-condition, is a stop criteria for a given generator. It will halt the generation of a test sequence when the given criteria is reached.
GraphWalker support the following stop conditions.

REACHED_EDGE, REACHED_VERTEX, EDGE_COVERAGE, VERTEX_COVERAGE, TEST_LENGTH, TEST_DURATION, REACHED_REQUIREMENT, REQUIEMENT_COVERAGE and NEVER.

These stop conditions are used through the GraphWalker Command line:

Command-line reference for stop conditions, as from the GraphWalker website, with one or two notes.

REACHED EDGE

The stop criteria is a named edge. When, during execution, the edge is reached, the test is stopped. Make sute that the edge is reachable in the model. Or exception is thrown by GraphWalker.
java -jar graphwalker.jar offline -f [file|folder] -g [generator] -s reached_edge:[Edge labe]

REACHED VERTEX
The stop criteria is a named vertex. When, during execution, the vertex is reached, the test is stopped.Make sute that the vertex is reachable in the model. Or exception is thrown by GraphWalker.

java -jar graphwalker.jar offline -f [file|folder] -g [generator] -s reached_vertex:[Vertex label]

EDGE COVERAGE
The stop criteria is a percentage number. When, during execution, the percentage of traversed edges is reached, the test is stopped. If an edge is traversed more than one time, it still counts as 1, when calculating the percentage coverage. In some models covering, getting a large percentage coverage, is very difficult. Due to the complexity of the model. When working with this. You will get experience in what number of coverage, that can be applicable for your project.And do note. That the test does not end in a predetermined state.
java -jar graphwalker.jar offline -f [file|folder] -g [generator] -s edge_coverage:[Coverage in %, between 1 and 100]

VERTEX COVERAGE

The stop criteria is a percentage number. When, during execution, the percentage of traversed states is reached, the test is stopped. If vertex is traversed more than one time, it still counts as 1, when calculating the percentage coverage.In some models covering, getting a large percentage coverage, is very difficult. Due to the complexity of the model. When working with this. You will get experience in what number of coverage, that can be applicable for your project.And do note. That the test does not end in a predetermined state.
java -jar graphwalker.jar offline -f [file|folder] -g [generator] -s vertex_coverage:[Coverage in %, between 1 amd 100]

TEST LENGTH
The stop criteria is a number, representing the total numbers of pairs of vertices and edges generated by a generator. For example, if the TEST_LENGTH is 110, the test sequence would be 220 lines long. (including 110 pairs of edges and vertices). This too is dependant of the model. If the model is modelled in a way which makes it hard to traverse recursively, then generating a large number of steps in the test, will be rare or impossible.And do note. That the test does not end in a predetermined state.
java -jar graphwalker.jar offline -f [file|folder] -g [generator] -s test_length:[Number of edge and vertex pairs to execute]

TEST DURATION

The stop criteria is a time, representing the number of seconds that the test generator is allowed to execute.This too is dependant of the model. If the model is modelled in a way which makes it hard to traverse recursively, then running the generation for a long sequence, will be rare or impossible. And do note. That the test does not end in a predetermined state.
java -jar graphwalker.jar offline -f [file|folder] -g [generator] -s test_duration:[Time in seconds]

REQUIREMENT COVERAGE

The stop criteria is a percentage number. When, during execution, the percentage of traversed requirements is reached, the test is stopped. If an requirement is traversed more than one time, it still counts as 1, when calculating the percentage coverage. This too is dependant of the model. If the model is modelled in a way which makes it hard to traverse recursively, then generating a sequence covering a large number of the requirements, will be rare or impossible.And do note. That the test does not end in a predetermined state.Again, mind how you model. the stop criteria, much be achievable.
java -jar graphwalker.jar offline -f [file|folder] -g [generator] -s requirement_coverage:[Coverage in %, between 1 and 100]

REACHED REQUIREMENT

The stop criteria is a named requirement. When the requirement is reached, the test is stopped. The same as "reached vertex" or "reached edge".Make sute that the requirement is reachable in the model. Or exception is thrown by GraphWalker
java -jar graphwalker.jar offline -f [file|folder] -g [generator] -s reached_requirement:[Requirement id]

NEVER

This special stop critera will never halt the generator. I hve never used this. But I would not say, it is not usable.
java -jar graphwalker.jar offline -f [file|folder] -g [generator] -s never