- How to export the test cases generated by Simulink Design Verifier after automatic testing?
- How to write or run these test cases as scripts (like in MATLAB or C)?
- How to set up inports and outports when making a test harness for the model?
SDV 사용시 자동 테스트 된 모델의 테스트 케이스를 Export 하는 방법 및 스크립트(코딩형태) 작성방법
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
DV(Design Verifier)를 사용하여 모델 자동 테스트 이후
커버리지 및 레포트는 확인 가능하나,
테스트때 사용된 테스트케이스를 추출하는 방법을 모르겠습니다.
또한, 테스트케이스를 스크립트(코드형태로 작성)로 작성하여 테스트 진행하고자 할 경우,
모델에서 하네스 생성시 inport/outport 설정을 어떻게 해야하는지와 스크립트(C코딩과같은) 형태로 테스트케이스를 생성할 수 있는지
문의 드립니다.
2 commentaires
Srikanth_Y
le 2 Sep 2025
Hi!
I used a translator to read the original question, so I just want to make sure I understood it correctly.
Are you asking about:
If I missed anything or misunderstood, please let me know! I’m happy to help once I understand the question fully.
Réponses (1)
Srikanth_Y
le 3 Sep 2025
Hi 형주,
Thanks for confirming! Here is how to approach exporting the automatically generated test cases and working with them in the given environment:
1. Exporting Test Cases to Excel: The MathWorks documentation provides a clear, step-by-step guide for exporting and generating test cases with Simulink Design Verifier:
This resource covers how to:
- Run SDV analysis
- Locate and load the results file (e.g., myModel_sldvdata.mat)
- Access and export test cases
After running the analysis, the results are saved in a file like myModel_sldvdata.mat. To export the input values (applied at each time step, such as every 10 ms) into an Excel file, try the following in MATLAB:
load('myModel_sldvdata.mat');
testCase = sldvData.TestCases(1).Data;
T = struct2table(testCase.signals);
T.Time = testCase.time;
writetable(T, 'testcase1.xlsx');
This will give a table in Excel showing the input values for each time step, which should help verify which values are applied at each 10 ms interval.
2. Using Test Sequences and Test Manager:
To run Test Sequences through the Test Manager:
- Open Simulink Test Manager and create a new test file.
- Add a test case, set up the Test Sequence block for input signals, and connect it to the model’s inports.
- Configure the simulation timing (e.g., 10 ms intervals), then run the test case.
- The Test Manager will execute the sequence and capture results for review and reporting.
3. Further Suggestions
- When generating a test harness, the inports and outports will match the original model, making it easier to connect your scripted sources and sinks.
- MATLAB scripts can automate the extraction and execution of test cases, as shown above.
- For exporting to formats like Excel, writetable is usually the most straightforward way.
Hope this helps.
0 commentaires
Voir également
Catégories
En savoir plus sur Results, Reporting, and Test File Management dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!