Where are Expected Outputs of Test Generation in Simulink Design Verifier?

조회 수: 10 (최근 30일)
When performing test generation using SDV, in the options you can checkmark the option to "Include expected output values" of the test cases generated. However, when I inspect the sldvData.mat file, I do not find the expectedOutputs. The dataValues, timeValues, etc. are all found within TestCases. Am I looking in the wrong place or is this a bug? I am using Matlab 2011b.
  댓글 수: 2
Ajay krishna Vasanthakumar
Ajay krishna Vasanthakumar 2020년 7월 28일
Hello Monika,
Can u please help me with answers for few questions?
  1. does SDV creates a dynmaic test vector (test value for each step time) or a static one ?
  2. If it creates dynamic test vector how many test vector does it creates?
  3. If the solver is variable step solver what will be the time interval of test value value generation?(like time=[1 2 3],values[4 5 6]).
I will be more happy if i get answer for these questions :)
Thanks
V. Ajay krishna
Pat Canny
Pat Canny 2020년 7월 30일
Hi Ajay,
Hopefully I can help:
#1: The test vectors generated by Simulink Design Verifier are meant to be simulated within Simulink. I assume this is what you mean by "dynamic".
#2: The number of test vectors generated depends on the number of objectives for which Simulink Design Verifier is trying to generate tests and the current tool configuration. In most cases, the tool will try to generate as few tests as possible to achieve the coverage objectives. However, you can modify this behavior by selecting a different 'TestSuiteOptimization' in sldvoptions . If this is set to 'IndividualObjectives', Design Verifier will generate a test case for each objective. If this is set to 'LongTestCases', Design Verifier will try to generate longer test cases to achieve more coverage objectives for a given test case. We generally recommend users start with the "Auto" setting for 'TestSuiteOptimization'.
#3: Simulink Design Verifier does not support variable step solvers. The solver must be Fixed-step: https://www.mathworks.com/help/sldv/ug/check-model-compatibility.html
Thanks.
- Pat

댓글을 달려면 로그인하십시오.

채택된 답변

Monika Jaskolka
Monika Jaskolka 2020년 3월 2일
This is a bug. I could not find a workaround other than to upgrade to a newer version of Matlab.
  댓글 수: 1
Pat Canny
Pat Canny 2020년 3월 6일
편집: Pat Canny 2020년 3월 6일
Hi Monika,
Sorry this question went unaddressed for so long! We have deliberately tried to do better in responding to MATLAB Answers more promptly in recent months. "SLDV MATLAB Answers Under New Management"
I realize this is an older question, but just to confirm your workflow (I'll use a shipping example; using R2019b):
open_system 'sldvdemo_cruise_control';
opts = sldvoptions;
opts.Mode = 'TestGeneration';
opts.ModelCoverageObjectives = 'MCDC';
opts.SaveExpectedOutput = 'on';
[ status, files ] = sldvrun('sldvdemo_cruise_control', opts, true);
load(files.DataFile) % loads sldvData from .mat file to workspace
% Plot expectedOuputs from first generated test case
timeValues_first_test = sldvData.TestCases(1).timeValues;
expectedOutputs_first_test = sldvData.TestCases(1).expectedOutput; % creates 2x1 cell array. Model has two outputs.
figure
plot(timeValues_first_test,expectedOutputs_first_test{1})
hold on
plot(timeValues_first_test,expectedOutputs_first_test{2})

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Generate Tests에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by