Sometimes, the toString() method of the coverage metrics does not show the total number of actions/states/transitions ... the number is replaced by "???". In the example below, I don't understand why ModelJUnit cannot calculate the total number of states. That should be easy by counting the states in the graph.
state coverage: 24/???
- 2u1p2m is covered 49 times
- 2u2p0m is covered 997 times
- 2u2p2m is covered 117 times
- 2u2p1m is covered 1512 times
- 1u0p0m is covered 726 times
- 1u2p2m is covered 24 times
- 3u2p0m is covered 521 times
- 1u1p0m is covered 777 times
- 1u2p0m is covered 538 times
- 1u2p1m is covered 471 times
- 3u2p1m is covered 912 times
- 2u0p0m is covered 650 times
- 1u1p2m is covered 16 times
- 2u0p1m is covered 14 times
- 1u1p1m is covered 130 times
- 3u1p1m is covered 385 times
- 3u2p2m is covered 68 times
- 3u1p2m is covered 20 times
- 3u1p0m is covered 520 times
- 2u1p1m is covered 588 times
- 2u1p0m is covered 1193 times
- 1u0p1m is covered 4 times
- 3u0p0m is covered 235 times
- 3u0p1m is covered 13 times
This is a known feature of ModelJUnit, intended to support testing large/infinite models without having to fully explore the model in advance.
Background:
ModelJUnit explores the graph incrementally, constructing the graph as it generates tests.
This means that until the graph is fully explored, the coverage metrics do not know how big the graph is (and some models can have extremely large, or infinite graphs).
So while the graph is still not completely explored, the coverage metrics show "NNN/???" as their description, because there is no sensible upper bound for the metric.
Workaround:
If you want to avoid the "/???" from coverage metrics, just call tester.buildGraph() before you start generating tests.
This will try to exhaustively explore your model, so that the graph is known completely.
Then your coverage metrics will report more precise upper bounds.