- Ensure that your main model (Main), library blocks (LibA, LibB), and referenced models (C) are well-organized in your project.
- Develop test harnesses for each individual library block (LibA, LibB) and referenced model (C). These harnesses should focus on covering the functionality of the library blocks and referenced models independently.
- In each test harness, enable coverage collection by navigating to Configuration Panel > Coverage > Enable coverage analysis. Ensure that you select the appropriate coverage metrics (e.g., decision, condition, MCDC).
- Execute the test cases on each library block and referenced model to collect coverage data.
- Create a separate test harness for the main block (Main). This harness will focus on the integration and interaction of all components. Execute the test cases for the same.
- Now go to Apps > Coverage Analyzer and open Result Explorer. Import the saved coverage results from the individual library blocks, referenced models, and the main block.
- Use the "Aggregate" section to combine these results into a comprehensive report.
Model coverage with library blocks and model reference.
32 次查看(过去 30 天)
显示 更早的评论
Good afternoon,
I'm trying to create a workflow for apllication development on simulink where one or more libraries and one or more projects can be referenced to access blocks and referenced models.
I've some trouble to understand how I can aggregate the coverage of my main blocks with the one obtained testing the library blocks and referenced models stand alone.
For example:
I have block Main that will instance library block LibA and LibB, In te same time it will refernced project X and use model C into the application.
I want at this point create test harnesses for the block Main without concerning directly in these harnesses of coverage of library blocks and referenced models. In this way, even if my harness won't cover 100% of LibA and LibB, this will be obtained by the harnesses dedicate to the library blocks. The same should work also for referenced models.
I'm not be able to reproduce this behaviour. Is there any guide or someone that can explain me how to approach to this problem?
0 个评论
回答(1 个)
Pramil
about 14 hours 前
Hi Claudio,
For your usecase, you can use the Coverage Analyzer app, you can learn more about Simulink coverage here:
Here's how you can achieve your usecase:
You can refer the following documentation as well, to know more about managing coverage results:
If you have any doubts, feel free to drop them here.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Collect Coverage for Models 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!