Testcase for 100% Model Decision Coverage in Stateflow
19 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
Arunkumar M
2018-11-9
First of all, I dont think it is a bug in Stateflow because I have performed coverage analysis and have successfully achieved 100% C1 and D1 coverage for many of my models.
- Without having a look at the structure of stateflow model it is difficult to say. Is it possible to provide an overview snapshot of statemachine without displaying details?
From your snapshot I could see that, substate exited when parent state exits is not getting satisfied. This could happen when you have used any empty transition (transition without any condition) or the transition condition is already satisfied which enables it to exit the state in one task cycle. Please note that, in each state, you have to stay atleast for more than 1 task cycle for achieving this coverage. Hope this helps.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Verification, Validation, and Test 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!