Test Condition - Constrain signal values in test cases

Library

Simulink Design Verifier

Description

When operating in test generation mode, the Simulink® Design Verifier™ software produces test cases that satisfy specified criteria (see Generating Test Cases). In this mode, you can use Test Condition blocks to define test conditions for signals in your model. The Values parameter lets you specify constraints on signal values during a test case simulation. Use the Initial parameter to specify whether the constraint applies throughout the entire test case simulation or only at its beginning. The block applies the specified Values parameter to its input signal, and the Simulink Design Verifier software attempts to produce test cases that satisfy the condition.

The block's parameter dialog box also allows you to

Specifying Test Conditions

Use the Values parameter to constrain signal values in test cases. Specify any combination of scalars and intervals in the form of a MATLAB® cell array (see Cell Arrays in the MATLAB documentation for information about working with cell arrays).

Scalar values each comprise a single cell in the array, for example:

{0, 5}

A closed interval comprises a two-element vector as a cell in the array, where each element specifies an interval endpoint:

{[1, 2]}

Alternatively, you can specify scalar values using the Sldv.Point constructor, which accepts a single value as its argument. You can specify intervals using the Sldv.Interval constructor, which requires two input arguments, i.e., a lower bound and an upper bound for the interval. Optionally, you can provide one of the following strings as a third input argument that specifies inclusion or exclusion of the interval endpoints:

As an example, the Values parameter

{0, [1, 3]}

specifies:

The Values parameter

{Sldv.Interval(0, 1, '[)'), Sldv.Point(1)}

specifies:

If you specify multiple scalars and intervals for a Test Condition block, the Simulink Design Verifier software combines them using a logical OR operation when generating test cases. Consequently, the software considers the entire test condition to be satisfied if any single scalar or interval is satisfied.

Data Type Support

The Test Condition block accepts signals of all built-in data types supported by the Simulink software. For a discussion on the data types supported by the Simulink software, see Data Types Supported by Simulink® in Using Simulink®.

Parameters and Dialog Box

Enable

Specify whether the block is enabled. If selected (the default), the Simulink Design Verifier software uses the block when generating tests for a model. Clearing this option disables the block, that is, causes the Simulink Design Verifier software to behave as if the Test Condition block did not exist. If this option is not selected, the block appears grayed out in the model editor.

Type

Specify whether the block behaves as a Test Condition or Proof Assumption block. Select Assumption to transform the Test Condition block into a Proof Assumption block.

Values

Specify the test condition (see Specifying Test Conditions).

Initial

Specify whether the Values parameter applies at the beginning of or throughout the entire test case simulation. If selected, the block constrains only the initial value of its input signal at the start of a test case simulation (t=0). If not selected (the default), the block constrains its signal value for the entire test case simulation.

Display values

Specify whether the block displays the contents of its Values parameter in the model editor. By default, this option is selected.

Pass through style

Specify whether the block displays an output port in the model editor. If selected (the default), the block displays its output port, allowing its input signal to pass through as the block output. If not selected, the block hides its output port and terminates the input signal. The following figure illustrates the appearance of the block in each case.

See Also

Proof Assumption, Test Objective

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS