Two different Decision Coverage results for the same line of code inside of a Stateflow State
1 view (last 30 days)
MathWorks Support Team on 29 Mar 2022
I am analyzing coverage for a model containing a Stateflow chart. The Decision Coverage analysis shows two coverage results for each IF-statement inside of a Stateflow State.
If it is a single decision, why would there be two separate results?
MathWorks Support Team on 16 Aug 2022
The separate results for a single line of code indicate that the code is being run both for the "Entry" and "During" actions of the Stateflow State. When contents of a State are not explicitly defined to be "Entry" or "During" actions, Stateflow treats the contents as both an "Entry" and a "During" action. As a line of code containing a decision point is reused in both the "Entry" and "During" actions, there are separate decision objectives for each action. The first two lines will indicate the coverage for "Entry" actions and the other two for "During" actions.