Code Coverage with Simulink Test

3 ビュー (過去 30 日間)
Carl-Jakob Ulmer
Carl-Jakob Ulmer 2015 年 9 月 30 日
編集済み: Sebastian Castro 2018 年 2 月 16 日
Hallo,
is it possible to measure the code coverage (not only model coverage) with Simulink Test? Is there a difference between model coverage and code coverage for Stateflow models?
Regards
  1 件のコメント
Sudhakar Akki
Sudhakar Akki 2015 年 12 月 15 日
編集済み: Sudhakar Akki 2015 年 12 月 15 日
Hello Carl,
Code coverage can be done with Polyspace Code Prover/S-function. in code coverage it is possible to check illegal typecasting, infinite loops and fixed-point quantization errors which is not possible in model coverage.
Regards, Sudhakar Akki

サインインしてコメントする。

回答 (2 件)

Sebastian Castro
Sebastian Castro 2015 年 10 月 5 日
編集済み: Sebastian Castro 2018 年 2 月 16 日
EDIT: This answer is from October 2015. Please see Paul Urban's comments below for the most updated answer.
Simulink Verification and Validation is the tool which allows you to collect model coverage, but not code coverage for auto-generated code. However, this is planned for a future release as several people have requested this functionality.
Right now, you can interface with the third-party code coverage tools BullseyeCoverage or LDRA Testbed as shown in this example.
To answer the other question: Having full model coverage significantly increases the likelihood of also having full code coverage. However, it's not 100% guaranteed and we always recommend testing the code coverage separately anyhow. This has to do with (among other reasons) external code you may be using, optimizations in the generated code, or libraries not being equivalent on the host (PC) vs. the target processor.
- Sebastian

Abhishek
Abhishek 2016 年 9 月 17 日
Starting 16a, you can collect model and code coverage from your tests in Simulink Test Manager: http://www.mathworks.com/help/sltest/ug/collect-model-coverage-in-tests.html
You also need Simulink Verification and Validation in addition to Simulink Test.
  1 件のコメント
Paul Urban
Paul Urban 2018 年 2 月 16 日
Starting in R2017b Simulink Coverage allows you to measure code coverage of the generated code in addition to model coverage. You can collect coverage when running tests in Simulink Test Manager.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeTest Execution についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by