How to write Assessments for both time/state dependent properties and state-less properties in Simulink Test

2 views (last 30 days)
How to write Assessments for both time/state dependent properties and state-less properties in Simulink Test with and without Simulink Design Verifier?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 17 May 2023
Edited: MathWorks Support Team on 17 May 2023
Without Simulink Design Verifier:
1) If there is only one time-/state-dependent property, then you can use steps and sub-steps.
Then, put the assert/verify statements for the stateless properties into the parent step (which runs always), and for the time-/state-dependent property into the sub-steps (which can have transition between sub-steps).
2) Another approach is to use more than one Test Sequence block. This is probably easiest if there are more than one time-/state-dependent property, so, you would put assessments for each property into its own Test Sequence block. You can add as many Test Sequences as needed into the Test Harness after it's created.
With Simulink Design Verifier:
1) Simulink Design Verifier checks for complete coverage of your model. If your model is 100% covered. You will be presented with the option of creating a test harness automatically. This will then create all the test cases for part of your model. This workflow is outlined in the documentation below:
Run below command in R2017b for documentation:
>> web(fullfile(docroot, 'sldv/ug/generate-test-cases-for-model-decision-coverage.html'))
Or refer to the following link for latest documentation:
To deal with time/state dependent properties, Simulink Design Verifier has the temporal operator blocks, Detector, Extender, and Within Implies.

More Answers (0)

Products


Release

R2017b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!