| ||||||
Chapter 13 Troubleshooting Coverage ProblemsReactis Tester and Validator use sophisticated algorithms to generate tests that maximize coverage criteria. Nevertheless, users will sometimes encounter models that present challenges to these algorithms: generated test suites may not provide coverage adequate to the users' needs. This chapter discusses strategies for overcoming such situations. When attempting to improve coverage, the following general strategy is often useful.
13.1 Modifying the .rsi FileIn many cases coverage can be improved if tighter bounds are imposed on input values in the .rsi file. Replacing range types by enumeration types can be especially handy, as can including appropriate resolution values: the goal in both cases is to reduce the number of possible values Reactis must consider when generating tests. Probability weights may also be used to affect the likelihood with which different conditions become true. For example, in some models large portions of the model become unreachable if an input flag has a certain value (e.g. this input might indicate the system being modeled should shut down). Assigning low probabilities to those values can increase coverage. Chapter 5 describes how .rsi files can be created and modified. When modifying the .rsi file in this fashion, it is good practice to save the modified .rsi file as a new file, so that the original settings are not overwritten. This can be done using the File -> Save Info File As... menu item in the top-level Reactis menu, as described in Chapter 5. Note that this operation automatically associates the new .rsi file with the model. The link to the previous .rsi file can be restored using the File -> Select Info File... menu item.
13.2 Modifying Test-Generation ParametersAnother approach for improving coverage is to change the parameters used by Tester and Validator. These parameters may be set in the launch screens of the respective tool and may be categorized as follows.
13.3 Test-Suite TuningIf adjusting the test-generation parameters still does not result in a satisfactory test suite, then some hand-tuning of the suite may be necessary. Reactis Simulator and Tester / Validator contain several features designed to facilitate this process, including test-suite preloading (Tester), and test-suite execution, breakpoints and test-suite editing (Simulator). The general strategy to be pursued may be summarized as follows.
The idea is to help Tester cover things it finds difficult while still letting Tester do as much work as possible. Coverage problems often arise because of difficult-to-satisfy conditions on Stateflow transition segments or within Simulink. Conditions might be difficult to satisfy for several reasons.
The strategy for coping with these problems can be summarized as follows.
The specific steps needed to implement this strategy are as follows. It is assumed that Simulator is already running and that the earlier test suite has been loaded.
The newly saved test suite may now be preloaded into Tester using the Preload file-selection box (make sure the Preload phase is enabled), and Tester rerun. This strategy may be repeated until an acceptable test suite is constructed. Be sure to save the resulting test suite so that it will not accidentally be overwritten by new runs of Tester. 13.4 Model DecompositionIf the steps described above still result in unsatisfactory coverage, consider testing subsystems of your model independently. Reactis makes this possible through a facility to extract subsystems from a model. The idea is to extract a subsystem, along with portions of the model involved in triggering the subsystem, and store the results as a new model in a separate .mdl file. The subsystem extraction utility is invoked by loading a model into Reactis, then right-clicking on the Simulink subsystem or Stateflow chart to be extracted, and selecting the “Extract Subsystem” entry in the pop-up menu. In the resulting dialog a filename under which to save the extracted subsystem may be specified. Reactis will then extract the subsystem, save it under its new name, open a new Reactis window, and load the extracted model. Note that the extracted subsystem is saved as a standard .mdl file. That makes it easy to edit the extracted model using Simulink if changes to the triggering mechanism or inputs or outputs of the model are necessary. If the extracted subsystem is a triggered subsystem or located within a triggered subsystem or contains triggered subsystems whose triggers are connected to something outside the extracted subsystem, Reactis will keep all blocks and charts that are part of the triggering mechanism. This works recursively, i.e. if the triggering block or chart is triggered itself, Reactis will trace back that trigger, too. To determine which subsystems might be candidates for independent testing, you can use the following strategy.
| ||||||
| ||||||