3.1 Debugging with Tester and SimulatorReactis Tester and Simulator support model debugging through the automatic
generation of test suites that thoroughly exercise the model under investigation
(Reactis Tester), and through the visualization of tests as they are executed
within the model (Reactis Simulator). One such usage scenario of Tester and
Simulator is shown in Figure 5. Since Tester’s guided-
simulation test-generation algorithm thoroughly simulates a model during test
generation, it often uncovers many run-time errors. For example, overflows,
missing cases, and bad array indexes can be discovered. Note that this type of
error is also detected when running simulations in Simulink; however, since
Tester’s guided-simulation engine systematically exercises the model much more
thoroughly than random simulation can, the probability of finding such modeling
problems is much higher using Reactis.
| Figure 5: Debugging Simulink models with Reactis Tester and Reactis Simulator |
Tester-generated tests may be executed in Simulator, which offers a number of
useful model debugging features; some of these are illustrated in
Figure 6. The figure includes a screenshot of Reactis invoked
on a Simulink/Stateflow model of an automotive cruise control system. This
example is one of several example applications included with the Reactis
distribution. The main window in the figure depicts the model hierarchy on the
left and an execution snapshot of a Stateflow diagram from the model on the
right. Reactis allows the user to choose between three distinct sources of
input values when visualizing model execution: -
Input values may be read from a Tester-generated test.
- They may be generated randomly.
- They may be supplied interactively by the user.
As depicted, input values come from Test 6 of a Tester-generated test suite. The
other model-debugging facilities illustrated in the figure are as follows. - Users may take forward or reverse execution steps when simulating model
behavior.
- Users may dynamically open scopes to view the values of Stateflow
variables or Simulink blocks and signals. An example scope, depicting how the
value of Stateflow variable mode varies over time, is shown. This scope was
opened by right-clicking on the mode variable in the diagram panel and selecting
“Open Scope.”
- Users may query the current value of any Simulink block or signal or
Stateflow variable by hovering over it with the mouse.
- Users may set execution breakpoints. In the example, a breakpoint has been
set in state Active of the Mode subsystem. Therefore, model execution will be
suspended when control reaches this state during simulation, allowing the user
to carefully examine the model before continuing simulation. Simulation may be
resumed in any input mode, i.e. reading inputs from the test, generating them
randomly, or querying the user for them.
- As shown in the execution snapshot, the current simulation state of the
model is highlighted in green and portions of the model that have not yet been
exercised during simulation are highlighted in red for easy recognition.
| Figure 6: Reactis Simulator offers an advanced debug environment
for Simulink models. |
|