Reactis for C Plugin

The Reactis for C Plugin integrates seamlessly with Reactis for Simulink to offer white-box testing and validation of the C-code portions of models (S-Functions, C Caller blocks, and calls to C from Stateflow). Together Reactis for Simulink and the C Plugin automate the generation of test data from, and validation of models constructed with Simulink, Stateflow, and C code.

If you currently build Simulink models that include C code, the Reactis for C Plugin will help you cut both the costs and time associated with development tasks such as the following:

  • Finding runtime errors in the C code (C Caller blocks, S-Functions, Stateflow custom code)
  • Testing the C code
  • Debugging the C code

By automating testing and validation of C code within the same environment that tests your Simulink and Stateflow, the Reactis for C Plugin enables you to do a more thorough analysis of your C code much more quickly.

Using the Reactis for C Plugin

When the C Plugin is not used, Reactis for Simulink treats C Caller blocks, S-Functions, and Stateflow custom C code as black boxes. Using the Reactis for C Plugin opens up these black boxes and gives you the capability to analyze the C code they contain.

Reactis Tester generates test data automatically from models. The tool selects test data using structural-coverage criteria, such as decision coverage, condition coverage, and Modified Condition/Decision Coverage (MC/DC). With the C Plugin, Reactis aims for structural coverage of the C code in addition to coverage of the Simulink and Stateflow portions of a model.

Reactis Validator allows you to instrument models with checks for assessing model behavior and targets for guiding the generation of test data. With the Reactis for C Plugin, the C portions of models may be subjected to this validation.

Reactis Simulator enables users to visualize model execution. Simulator's user interface is similar to those of traditional debuggers from programming languages: it allows you to step through the execution of models by hand as well as set break points. Simulator also supports reverse execution, the replay of tests generated by Reactis Tester, the graphical display of different coverage metrics, and the capability to fine-tune Tester-generated test suites.

With the Reactis for C Plugin these advanced debug capabilities extend beyond Simulink and Stateflow and into C code. Step seamlessly from Simulink into an S-Function or C Caller block, or from Stateflow into custom C code. You can also set break points and track coverage in the C code.

Generating Tests

Tester, the test-generation component of Reactis, relies on model coverage metrics (aka coverage criteria) to construct tests. The tool tracks several coverage criteria as it computes test data, and uses uncovered elements of these criteria to influence subsequent tests that it creates.

With the Reactis for C Plugin, Tester measures coverage in the C code as well as in the Simulink and Stateflow portions of a model. The new coverage targets include C statements, as well as decisions, conditions, and MC/DC targets in the C code. The net effect is more comprehensive tests than only tracking coverage targets in the Simulink and Stateflow portions of the model.

Tester employs a patented technique called guided simulation to build tests. Tests in Reactis correspond to simulation runs, with the inputs at each step in a run constituting the input data used for the test. At each step in a simulation run, Tester uses information about uncovered parts of the model and C code to select input data that will advance the coverage of the model.

Finding Runtime Errors

The Reactis for C Plugin performs a variety of checks that flag runtime errors to help you to find, diagnose, and fix runtime errors in your S-Functions, C Caller blocks, and Stateflow custom code.

Memory errors are particularly easy to make in C and can be very hard to debug. The Reactis for C Plugin automatically detects memory errors. A memory error occurs whenever a program reads-from or writes-to an invalid address. Some common memory errors include out-of-bounds array indexes, buffer overruns, dangling heap pointers (accessing a region of heap-allocated memory after the memory has been freed), dangling stack pointers (accessing a pointer to a local variable of a function after the function has returned) and the use of pointers cast from incorrect numeric values.

If Reactis Tester detects a runtime error, it returns a test that can be run in Reactis Simulator to show the exact sequence that leads to the error.

Try the Reactis for C Plugin!

We hope you will try the Reactis for C Plugin to see how the tool can help test and debug your S-Functions, C Caller blocks, and Stateflow custom C code. To download a free, fully functional evaluation copy of the C Plugin, please visit the Reactis User Pages.

If you would like to learn more, an 8-minute video shows how the Reactis for the C Plugin can be used to test and debug C Caller blocks, S-Functions, and Stateflow custom code.

If you decide to buy, the Reactis for C Plugin can be licensed on either a perpetual or an annual basis, with both node-locked and floating options available.