RSI Logo
Google
Reactis: Model-Based Testing and Validation
 
 Reactis User's Guide   Contents  |  Index
 Chapters:  1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20

Chapter 8  Reactis Tester

Tester generates suites of test cases automatically from Simulink / Stateflow models. Each test consists of a sequence of stimulus / response pairs, where each stimulus assigns an input value to each top-level inport of the model and each response records an output value for each top-level outport. The tests may be run on Simulink / Stateflow models using either Reactis Simulator or the Simulink simulator produced by The MathWorks, Inc. They may also be used to drive testing of source code implementations of models. These topics are covered in Chapter 12.

The test suites are intended to maximize different coverage objectives while minimizing the total number of execution steps in the overall suite. The remainder of this chapter describes the workings of Tester.

8.1  The Tester Launch Dialog

Figure 8.1 contains an annotated screen shot of the Tester launch dialog, which may be invoked from the Reactis top-level window using the Test Suite -> Create... menu item. This section describes the labeled items in the figure.


Figure 8.1: The Reactis Tester launch dialog.

  1. Enable/disable the preload phase. This phase loads existing test suites (specified by the user in window item 4) to be extended by the new Tester run.
  2. Enable/disable the random phase, which is described below.
  3. Enable/disable the targeted phase, which is described below.
  4. A list of .rst files containing test suites to be preloaded. When the check-box to the left of a filename is checked, unnecessary steps (those that do not increase the level of coverage) will be pruned from the preloaded test suite. When the check-box is not checked, no pruning of the suite will occur.
  5. Clicking this button invokes a file-selection dialog that enables the user to specify an .rst file to be added to the preload list.
  6. Clicking this button removes the currently selected .rst file from the list of test suites to be preloaded.
  7. Number of tests in the random phase. Because of pruning that occurs at the end of the random phase, some tests may be eliminated entirely, leading to a smaller number of tests at the end of the random phase than what is specified here.
  8. Number of steps in each test of the random phase. Upon completion of the random phase, unimportant steps are pruned from the tests, so the lengths of the final tests will usually be shorter than the length specified here.
  9. Using this entry box, the user may specify the number of execution steps to take during the targeted phase. The targeted phase uses sophisticated strategies to guide the simulation to exercise parts of the model not visited during the initial phases. The number in this entry specifies an upper bound on the number of simulation steps executed during this phase.
  10. The Coverage Objectives section enables the user to specify the coverage criteria used to guide test generation. Each coverage criterion defines a set of target elements in models to exercise. The criteria supported by Tester are described in Chapter 6.
  11. This entry box enables the user to pass one or more of the following parameters to Tester :
    • -a {0|1} turns inputs abstraction on (1) or off (0). Inputs abstraction usually improves the performance of Tester and should be left on (default). In rare cases, turning it off may improve coverage. If coverage problems are encountered with inputs abstraction on, it may be beneficial to take a test suite produced with abstraction on, preload it into Tester, turn abstraction off, and then run Tester again.
    • -s randomSeed seed for the random number generator. This is useful for replaying a previous run of Tester. The random seed used to create a .rst file can be found in the test-suite log (which may be viewed in the Test Suite Browser described in Chapter 11), after the “-s” in the “Created by Tester:” line.
  12. The name of the .rst file to be generated.
  13. Clicking this button opens a file-selection dialog for specifying the name of the .rst file to be generated.
  14. Clicking this button displays on-line Tester help.
  15. Clicking this button opens a file selection dialog to specify an .rtp file from which to load Tester launch parameters. Reactis may be configured from the Settings dialog to generate an .rtp file for each Tester or Validator run.
  16. Reset the Tester parameters to their default values.
  17. Scroll backward in the parameter history.
  18. Scroll forward in the parameter history.
  19. Clicking this button starts test-suite generation.
  20. Clicking this button closes the Tester window.

8.2  The Progress Dialog


Figure 8.2: The Reactis Tester progress dialog.

The Tester progress dialog, shown in Figure 8.2, is displayed while Tester is running. What follows describes the labeled items in the figure. When Tester completes, buttons 711 become enabled.

  1. Status message describing current Tester activity.
  2. Time elapsed (real time) since start of test generation, and estimated time until test generation completes.
  3. Total number of simulation steps to be taken during test generation, and the percentage thereof taken so far. Note that since many steps are pruned from final test suite, this number will typically be much larger than the cumulative number of execution steps in the generated test suite.
  4. Progress bars that report percentages of reachable targets covered for Simulink-specific coverage criteria. These criteria are described in Section 6.1.
  5. Progress bars that report percentages of reachable targets covered for Stateflow-specific coverage criteria. These criteria are described in Section 6.2.
  6. Progress bars that report percentages of generic (applying to both Simulink and Stateflow) coverage criteria. These criteria are described in Section 6.3.
  7. When warnings occur, this button may be clicked to view descriptions of the warnings.
  8. Open the Reactis Test Suite Browser and load the newly generated test suite.
  9. Enable Reactis Simulator and load the newly generated test suite.
  10. View the model with coverage information for the newly generated test suite represented by highlighting the diagram elements of the model.
  11. View the model with coverage information for the newly generated test suite in the Coverage-Report Browser.
  12. View help for the progress dialog.
  13. Go back to the Tester launch dialog.
  14. Interrupt test generation and write the tests generated so far to an .rst file.