Main Content

Assessments, Criteria, and Verification

Logical and temporal verification, data comparison, value and time tolerances, specialized results processing

Functional testing includes assessing simulation behavior and comparing simulation data to expected results. You can assess simulation behavior by:

  • Using temporal and logical assessments in a test case.

  • Including verify statements and other operators in a Test Assessment or Test Sequence block. Use the Test Sequence block to specify a series of steps to stimulate the component or system under test. Use the Test Assessment block to assess the behavior of the component or system under test.

  • Using blocks from the Model Verification library.

You can assess simulation data by:

  • Comparing test output to baseline data or comparing the output of two simulations using equivalence criteria.

  • C

  • Using value or time tolerances when comparing simulation data to baseline data or comparing two simulations. The available types of tolerances are relative, absolute, leading, and lagging. Leading and lagging tolerances are useful for comparisons in which the data timing differs, such as comparisons between different solvers, or comparisons between models running on your desktop and code running on a target.

  • Using a custom criteria script to process simulation data.

For an overview of the different verification methods, see Assess Simulation and Compare Output Data.

Blocks

Observer ReferenceCreate and contain an Observer model (Since R2019a)
Observer PortWirelessly link signals to use with verification (Since R2019a)
Test SequenceCreate simulation testing scenarios, function calls, and assessments
Test AssessmentAssess and verify behavior of system under test
Sequence ViewerDisplay messages, events, states, transitions, and functions between blocks during simulation
AssertionCheck whether signal is zero

Classes

sltest.testmanager.AssessmentLogical or temporal assessment object (Since R2022a)
sltest.testmanager.AssessmentSymbolSymbol used in assessment (Since R2022a)
sltest.testmanager.TestCaseCreate or modify test case

Tools

Test ManagerModel and code testing in different execution environments, manage test suites, and analyze and report results

Syntax Operators

expand all

verifyAssess logical expression and automatically log result
assertEvaluate logical expression and stop simulation if false
etElapsed time of test step
tElapsed time of simulation
afterElapsed time since beginning of test step
beforeElapsed time until specified time in test step
durationElapsed time since beginning of test step
hasChangedDetect data change in test step
hasChangedFromDetect data change from specified value in test step
hasChangedToDetect data change to specified value in test step
squareSquare wave test signal
sawtoothSawtooth wave test signal
triangleTriangle wave test signal
rampReturn input value for test signal generation
heavisideHeaviside step test signal
latchSave value of an expression

Topics