RSI Logo

Model-Based Testing and Validation with Reactis®

White Paper: Model-Based Testing and Validation with Reactis
spacer
Download PDF: Letter  |  A4



 
Spacer

4.1  Software Testing

A crucial aspect of the tests generated by Reactis Tester is that they also store model outputs. Therefore, these tests encode all the information needed to ensure that model-derived source code conforms to its model. Reactis-driven source-code testing proceeds as follows:

  1. For each test in the suite, execute the software using the input values contained in the test.
  2. Compare the output values produced by the software with those stored in the test.
  3. Record any discrepancies.

This methodology is referred to as model-based software testing, and its key advantage is that the model serves as an “oracle” for testing purposes: the outputs produced by the model can be used as a basis for assessing those generated by the software. If the software does not agree with the model, then the developer can assume that the problem lies within the source code.

The net effect of model-based testing with Reactis is better-quality software at a lower cost. Because good test data is generated and run automatically, less engineer time is required to create and run tests. Because the tests are thorough, the probability of finding bugs is maximized. Because the test suites are compact they may be run quickly. In sum, Reactis dramatically reduces the costs of testing embedded control software.

Figure 8 illustrates how the Reactis tool suite can provide advanced model-based testing of source code. As the figure indicates, the model-based testing protocol supported by Reactis is as follows:


Figure 8: Testing for conformance of code to model with Reactis.

  1. The developer provides as input to Reactis a .mdl file representing the validated Simulink/Stateflow model of the system under development.
  2. Reactis Tester is used to automatically generate a test suite that thoroughly exercises the given model according to the various coverage criteria supported by Reactis.
  3. The developer may deploy Reactis Simulator to visualize test execution and to fine tune the tests in the test suite to further improve model coverage.
  4. The test suite and the software implementing the model are fed as inputs into a test harness to automate the source-code testing process.
  5. By comparing the outputs produced by the software and the model when executing tests in the test suite, deviations in the behavior of the source code from the model are readily detectable and guide the developer in ensuring that the source code conforms to the model.
  6. Testing concludes when the source code passes all the tests in the test suite.