在 Polyspace 平台用户界面中执行代码探查
计算与现有测试相关的 C/C++ 源代码覆盖率、计算执行时间
您可以在 Polyspace 平台用户界面中计算 C/C++ 代码覆盖率、执行时间或内存使用。在启用了覆盖率、执行探查或内存探查的情况下执行测试后,您可以结合测试结果来查看测试覆盖了多少代码,或查找执行时间或栈使用量方面的瓶颈。
Polyspace 选项
MATLAB 函数
pstest.exportToPolyspaceProfilingResults | (MATLAB Function) Export coverage results from Simulink Coverage, Simulink Test, or MATLAB Test to Polyspace Test |
主题
代码覆盖率
- Calculate C/C++ Code Profiling Metrics in Polyspace Platform User Interface
Calculate code coverage, execution time, and memory use of graphically authored tests on your host computer. - Review C/C++ Code Coverage Results in Polyspace Platform User Interface
Review condition, decision, MC/DC, and other coverage metrics in Polyspace® Platform user interface or Polyspace Access™ web interface. - Merge Coverage Results from Simulink Coverage and Polyspace Test
Gather coverage of generated code using Simulink® Coverage™, coverage of hand written code using Polyspace Test™, and see the merged result in the Polyspace Platform user interface.
执行时间和内存使用
- Review and Address Execution Time Results
After calculating the execution time of your code, review the results and address bottlenecks in execution time. - Review and Address Memory Use Results
After calculating the stack memory use of your code, review the results and address possible stack overflow.
代码清理
- Run C/C++ Code Sanitizer and Review Results in Polyspace Platform User Interface
Enable code sanitizer, view sanitizer results as test failures or in sanitizer profiling report. - Issues Detected Using Polyspace Test Code Sanitizer
Find out which issues can be detected at runtime when executing tests with code sanitizer enabled.