RSI Logo

Model-Based Testing and Validation with Reactis®

White Paper: Finding Bugs in C Code with Reactis for C
spacer
Download PDF: Letter  |  A4



 
Spacer

4  Reactis Validator

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

Reactis Validator performs automated searches of programs for violations of user-specified requirements. If Validator finds a violation, it returns a test that leads to the problem. This test may then be executed in Reactis Simulator to gain an understanding of the sequence of events that leads to the problem. Validator enables the early detection of software defects and reduces the effort required for code reviews. Some checks that may be performed with Validator include the following.

  • Will a variable’s value ever fall outside a desired range?
  • Will a car’s cruise-control maintain vehicle speed within acceptable limits of the set speed?
  • Will a car’s brake pedal always override the cruise control?
  • Will a car’s brake pedal always override the electronic throttle control?
  • Will a plane’s thrust reversers ever engage when the aircraft is airborne?
  • Will an x-ray machine ever deliver a dangerous dose of radiation?
  • Will a cellular phone “hang” when moved from a non-serviced into a serviced area?

Figure 7: Reactis Validator automates functional testing.

Figure 7 shows how engineers use Validator. First, a program is instrumented with Validator objectives. There are two forms of Validator objectives, assertions and user-defined coverage targets. An assertion is a boolean C function which should always return a true (non-zero) value. A user-defined coverage target is a boolean C function which should return a true result at least once during testing. During the instrumentation process, objectives can be inserted at any point within a C program using the Reactis for C GUI. Note that all objectives are stored in a separate library and none of the actual C source files are modified. The purpose of Validator is to produce a test suite which triggers assertion violations and/or covers all user-defined coverage targets.

After the program is instrumented, Reactis Validator performs an automated search for an execution scenario that leads to a violation of an assertion. If Validator finds an assertion violation, it returns a test that leads to the problem. This test may then be executed in Reactis Simulator to gain an understanding of the sequence of events that leads to the problem.

Reactis for C Validator reduces the effort required to detect software defects prior to code release, which in turn reduces overall development costs.