GraphWalker / graphwalker-project

This is the repo for the Model-based testing tool GraphWalker.

Home Page:http://graphwalker.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stop condition incorrectly fulfills a generator

KristianKarl-zz opened this issue · comments

When running the attached model it completes without problem. This is not expected. The start element of the model is the only edge.

  1. Run following command with the attached model:
    java -jar graphwalker-cli-4.0.0-SNAPSHOT.jar offline -g issue.json
    {"currentElementName":"b"}
    {"currentElementName":"B"}

Expected result:
An exception thrown: NoPathFoundException. Since the start element is set to the only edge b in the model, the vertex A never is visited, thus, the stop condition edge_coverage(100) can never be reached.

Actual result:
GraphWalker generates a path, and ends in vertex B
model

The zipped model foo.json: foo.zip

I suspect that the RuntimeModel don't have the A vertex, due to that it's not part of the connected component (seen from the edge b) and I think that this is the expected result, not a bug. But it would be nice if elements not part of the RuntimeModel would be marked in some way, in the editor, so that the user understand which part of the model is actually used for the current execution.

Good pointer! So I checked.
The RuntimeModel object passed to the context has 2 vertices and 1 edge. And they look correct to me.The A vertex is there, with the correct id. The edge has that A vertex as the source vertex.

So it must be something else...

While debugging I found the problem - me!
The behavior is correct. Because the edge coverage is 100%