Modify, update, add, edit as seems appropriate
Transition Coverage
- Correct state is entered at initialization of the state machine
- Exercises each arc in the statechart at least once. (As a natural
consequence this enters each state at least once for a well-formed statechart.)
- Checks that correct state is entered after each arc being tested. (Does not
have to re-check for arcs that have previously been tested and checked.)
- Checks that correct output values are sent while in each state.
- Optional: checks that irrelevant values do not cause a state transition.
Data Coverage & Branch Coverage
- MC/DC coverage on guard conditions for arcs
- For example, if a guard condition is (A && B), three unit tests for
that arc: {A true, B true, arc taken}, {A false, B true, arc not taken}, {A
true, B false, arc not taken}
- Test that irrelevant inputs do not cause arc transitions.
- For example, if a guard condition is (A && B), test that with {A
false, B false} some other variable C true does not cause transition. There are
likely too many of these combinations, so try a few that seem reasonable to
check.
- Defaults in switch statements tested via an "INVALID" enum value
or similar.
- Identify any code in the implementation not reached by 100% transition
coverage:
- Does this code reveal a defect in the statechart?
- Do unit tests attain 100% branch coverage of this code?
Last update 10/3/2020