Hey all,
I am testing a Stateflow implementation and I have some issues in achieving 100% D1 in Model Coverage.
About the Model Coverage in Stateflow you can find Mathworks' description HERE . It is described that how Model Coverage Report is generated:
- How many times each exclusive substate is executed or exited from its parent superstate and entered due to parent superstate history;
- How many times each transition decision has been evaluated as true or false;
- How many times each condition has been evaluated as true or false.
As it can be observed in the attached screenshot from my report, testcases are able to enter each of the states. States' names are blurred (company policy) and anyway they do not help in answering of this question. : ) The problem appears due to the fact described in the first bullet point: substate exited when parent exits.
I have to say that the testcases, which were written for the state where I have 2/2, were reused for the other states.
I would like to ask for some instructions how to write a 'good' testcase which can validate the red lines.
Or is it a bug of Stateflow?
Any help / suggestion is welcomed.
Thanks, Ferenc
Best Answer