How to Analyze Coverage Using Test Case Traceability
Model coverage and code coverage measure testing completeness in your models and generated code. Learn how to use Simulink Test™ and Simulink Coverage™ to analyze missing coverage using test case traceability data in the coverage report.
Published: 20 May 2021
Model coverage and code coverage measure how much of your Simulink models and generated code were exercised during simulation.
In this video, I’ll show you how to use Simulink Test and Simulink Coverage to analyze missing coverage using test case traceability data in the coverage report.
Here is a test suite I am managing using Simulink Test. This test suite contains requirements-based tests for a Cruise Control algorithm implemented using Stateflow. Each test case is linked to requirements managed in Requirements Toolbox.
After running the test suite, I can first view the overall coverage results in the Test Manager. For more details, I can generate a Coverage Report to see which parts of the design were exercised during simulation. I can also see which tests achieved a given coverage objective.
Let’s look at the coverage for the “ON” state.
This section of the coverage report shows the coverage objectives associated with the “ON” state, as well as which test case initially achieved each coverage objective.
There is an uncovered objective for the “Accel” substate. We can see in the table that the “Accel” substate was partially exercised by test case T3. A simple next step is to look at test case T3 by clicking on the hyperlink in the table to see how we could supplement that test case to completely cover the “Accel” substate
Once I have finished testing my model, I can run tests on the generated code by simulating the model in Software-in-the-Loop mode. I can use the same approach I used while testing the model by looking at the test case traceability data in the coverage report.
This example showed how to use test case traceability data in the coverage report to understand how to fully exercise your Simulink models and generated code.
Click on the link below to try the example.
For more information, please visit the Simulink Coverage product page on mathworks.com
Related Products
Learn More
Featured Product
Simulink Coverage
Up Next:
Related Videos:
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)