Stateflow    

State Report Section

The example state section contains a report on the state On. The Stateflow diagram for On is as follows:

On resides in the box Heater, which has its own details report (not shown) because it contains other Stateflow objects. However, because On is a superstate containing the two states HIGH and NORM along with a history junction and the function warm, it has its own numbered report in the Details section.

The decision coverage for the On state tests the decision of which of its states to execute. The results indicate that six of a possible six outcomes were tested during simulation. Each decision is described as follows:

  1. The choice of which substate to execute when On is executed
  2. The choice of which state to exit when On is exited
  3. The choice of which substate to enter when On is entered and the History junction has a record of the previously active substate

Because each of the above decisions can result in processing either HIGH or NORM, the total possible outcomes are 3 x 2 = 6.

The decision coverage tables also display the number of occurrences for each decision and the number of times each state was chosen. For example, the first decision was made 124 times. Of these, the HIGH state was executed 88 times and the NORM state was executed 36 times.

Cyclomatic complexity and decision coverage are also displayed for the On state including its descendants. This includes the coverage discussed above plus the decision required by the condition [warm()] for the transition from HIGH to NORM for a total of eight outcomes. Condition coverage and MCDC are both not applicable (NA) coverages for a state.


  Chart as Superstate Report Section Transition Report Section