4. Reactis Validator#

The verification and validation capabilities of Reactis for C help engineers detect bugs earlier, when they are less costly to fix.

Reactis Validator automatically searches C programs for violations of user-specified requirements. When a violation is discovered by Reactis Validator, a test which triggers the violation is produced. This test can then be executed in Reactis Simulator to gain an understanding of the sequence of events that leads to the violation. Validator helps detect defects early in the software life-cycle and reduces the effort required for code reviews. Some checks that may be performed with Validator include the following:

  • Will a particular program variable ever fall outside a specified range?

  • Will a thermostat maintain ambient temperature within acceptable limits of the desired temperature?

  • Will engaging a vehicle’s brake pedal always override the electronic throttle control?

  • Will a radiation therapy machine ever deliver a dangerous dose of radiation?

  • Will anti-lock brakes disengage whenever a vehicle begins to skid?

Figure 4.1 illustrates how Validator is used. First, a program is instrumented with Validator objectives. There are two kinds of Validator objectives, assertions and user-defined coverage targets. An assertion is a boolean C function which should always return a true (i.e., non-zero) value. A user-defined coverage target is a boolean C function which should return a true result at least once during the test process. The actual instrumentation process involves inserting reactis_assert and reactis_target statements into your code. The purpose of Validator is to take a program and a set of objectives and produce a test suite which triggers assertion violations and covers all user-defined coverage targets.

_images/reactis-for-c-validator.png

Fig. 4.1 Reactis Validator automates functional testing.#

Once the program has been instrumented, Reactis Validator performs an automated search for a sequence of input values which, when executed, leads to the violation of an assertion. Whenever an assertion violation is found, Validator produces a test that triggers the violation. This test may then be used within the interactive execution environment of Reactis Simulator in order to understand the sequence of events which causes the problem.

Reactis Validator makes it possible to detect software defects prior to code release with less effort, which in turn reduces overall development costs.