Erroneous state coverage with AllRoundTester
Status: Beta
Brought to you by:
marku
When doing something like the following:
Tester tester = new AllRoundTester(model);
tester.buildGraph();
tester.addCoverageMetric(new StateCoverage());
tester.generate(20);
tester.printCoverage();
the reported state coverage is wrong: it correspond to the states seen since the last reset, not the total number.
This workaround gives me the right number:
tester.addCoverageMetric(new StateCoverage() {
@Override
public String getName() {
return "Total state coverage";
}
});
Interesting bug! Turns out that AllRoundTester uses a StateCoverage metric internally, so later StateCoverage metrics added by users were ignored.
Fix: AllRoundTester now renames the StateCoverage metric that it uses internally, so that users are free to add their own StateCoverage metric if desired.
Thanks Grégoire for such a clear and useful bug report.