Testcase for 100% Model Decision Coverage in Stateflow

조회 수: 19 (최근 30일)
Ferenc Fodor
Ferenc Fodor 2018년 10월 23일
답변: Arunkumar M 2018년 11월 9일
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

채택된 답변

Arunkumar M
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개)

카테고리

Help CenterFile Exchange에서 Verification, Validation, and Test에 대해 자세히 알아보기

제품


릴리스

R2015b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by