Illegal and Multiple Transitions
Automated Testing
Diagrams
During the execution of the test, Component Testing for C++ generates trace data this
is used by the UML/SD Viewer. The Component Testing for C++ sequence diagram
uses standard UML notation to represent both Contract-Check and Test Driver
results.
·
Class Contract-check sequence diagrams,
·
Test Driver Sequence Diagrams.
Both types of results can appear simultaneously in the same sequence diagram.
When using Runtime Tracing with Component Testing for C++, all results are
generated in the same sequence diagram.
Illegal and Multiple Transitions
When dealing with state or transition diagrams, Component Testing for C++ adds a
custom
observation state
, which is both the initial state and error state. All user-
defined states can make a transition towards the
initial/error
state, and this state can
transition towards all user-defined states.
At the beginning of test execution, the object is in the initial/error state.
During the test, the object is continuously tested to comply to the user-defined
STATEs and TRANSITIONs. There are three possible cases.
·
The transition can be fired to a single state: the current state is set.
·
The transition cannot be fired to any of the defined states: in this case, the state
switches to the observation state and Component Testing for C++ generates an
ILLEGAL TRANSITION note.
·
The transitions can be fired to two or more states. In this case, the transition
diagram is no longer unambiguous. The state is set to the observation state and
Component Testing for C++ generates a MULTIPLE TRANSITION.
When the state diagram is in the
initial/error
state, the transition is still continuously
checked, however all user defined states can be potentially fired.
Contract-Check Sequence Diagrams
The following example shows how a typical class contract is represented by
Component Testing for C++. C++ classes are represented as vertical lines, like object
instances. The events related to the class - method entry and exit, assertion and state
chart checks - are attached to the class lifeline.
171