Contenuto principale

Add a Logical Assessment to a Test Case and Review Results (Tech Preview)

R2026b
Since R2026b

Note

The redesigned Simulink® Test Manager is a tech preview in R2026b. The primary purpose of the tech preview is to provide early access to the most common testing workflows. For more information about supported workflows, see Overview of the Redesigned Simulink Test Manager (Tech Preview).

To enable the feature, click the New Test Manager button in the existing Test Manager or use the sltest.stmv2.open function at the command line.

This step of the example shows how to assess signal behavior during simulation by using the redesigned Test Manager. In this step, you configure the fuelsys_stm test file by adding a test interface, and creating a bounds check for a signal in the model. Then, you run the test, and review the results.

Prepare the Test Interface for Logical and Temporal Assessments

To add a bounds check assessment, modify the test interface by creating a test alias for a signal and defining component under test (CUT) workspace variables. You use the test alias to specify the signal to assess. You create workspace variables to define the boundary values for the assessment. To create the test alias and workspace variables:

  1. In the Test Files pane, click fuelsys_stm_CUT. In the Signals section, in the fuelGain signal row, double-click the cell in the Test Alias column. Enter fGain and press Enter.

    Tip

    Because you define test aliases in the CUT, you can reuse them in all test cases in the CUT.

  2. In the Workspace pane, add two variables by clicking Add Variable twice.

    CUT Workspace pane with two new variables and the fGain alias

  3. To set the name and value of the variables, double-click the Name and Value cells and enter:

    NameValue
    UpperBound6
    LowerBound2

Create a Logical Assessment

Add a bounds check assessment that verifies that the fGain signal stays between the upper and lower bounds during simulation:

  1. In the Test Files pane, right-click Test Case 1 and select Rename. Enter AssessmentTest.

  2. Click AssessmentTest. In the Prepare Test Case section on the toolstrip, select Logical and Temporal.

  3. In the Logical and Temporal Assessments section, click Add Assessment > Bounds check.

  4. In the table, beneath the new assessment, set bound-check-pattern to always inside bounds.

  5. Set signal to fGain and set these boundary conditions:

    • lower-bound — LowerBound

    • lower-bound-type — greater than

    • upper-bound — UpperBound

    • upper-bound-type — less than

    Bounds check assessment configured to check that the fGain signal stays inside the lower and upper bounds

  6. In the toolstrip, click Save.

Review Logical Assessment Results

To identify where and when the fGain signal fails to satisfy the boundary conditions, run the test and examine the results:

  1. To run the test with the default run settings, click Run.

  2. The redesigned Test Manager opens the results app. In the Test Results pane, expand the new result set, the test case, and the Logical and Temporal Assessments section. The assessment has a FAIL result.

    Test Results pane with Assessment1 showing a fail outcome

  3. Select Assessment1. The Assessment1 tab displays the overall results details. The assessment fails because fGain becomes greater than the UpperBound variable.

    Assessment1 overall results comparing expected behavior to actual result, with explanation of failures at 2.02 s and 6 s

  4. To view additional details for the first failure, click the right arrow next to the drop-down list.

    Error 1 of 2 detail showing fGain exceeding upper bound from 1.16 s to 2.96 s

In the next step, you use run settings and runlist files to run a back-to-back test. See Create and Run a Back-to-Back Test (Tech Preview).

See Also

Topics