Is code coverage for a model equal to code coverage of generated code?
古いコメントを表示
Hi,
I use Simulink Verification and Validation toolbox to measure the code coverage while simulating the model with an automated test execution. In coverage settings I checked "Decision" and "Condition" and get in the coverage report a C1 and D1 result.
My question is how this results correlate with the code coverage of the generated code? Is it same? E.g. C1 and D1 is 100%, do I automatically have 100% for the generated code?
Thanks
Simulink version: R2014a
2 件のコメント
Carl-Jakob Ulmer
2015 年 9 月 18 日
Sebastian Castro
2015 年 9 月 18 日
Yes, the same principles hold for Stateflow... so you should really test code coverage as well if you can!
採用された回答
その他の回答 (1 件)
Jeevan Thomas
2015 年 9 月 17 日
1 投票
Coverage of a model doesn't necessarily reflect coverage of generated code.
In the generated code, there will be utility functions/routines generated as part of block settings (for ex: rounding, saturate on integer overflow, div-by-zero etc) which will not be covered using Simulink V&V.
Also optimization settings plays a part too.
For code coverage, you could try tools such as BTC EmbeddedTester (works better with TargetLink as code generator), ReactisForC, BullEyeCoverage etc.
カテゴリ
ヘルプ センター および File Exchange で Simulink Coder についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!