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

9 ビュー (過去 30 日間)
Monika Jaskolka
Monika Jaskolka 2014 年 10 月 1 日
コメント済み: Pat Canny 2020 年 7 月 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 Center および File ExchangeGenerate Tests についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by