审查代码探查结果
审查代码覆盖率、执行时间或内存使用度量
在启用了代码探查的情况下执行测试后,您可以在 Polyspace 平台用户界面中审查代码探查结果。该结果由以下度量之一组成:
代码覆盖率 - 现有测试覆盖了多少代码。
代码执行时间 - 每个函数执行所用的时间。
内存使用 - 每个函数使用的栈内存。
代码清理器结果 - 测试执行期间的运行时错误。
例如,如果您针对现有测试计算了代码覆盖率,则可以在仪表板上查看覆盖率结果的摘要,或在列表视图中向下钻取以查看文件、函数、决策和条件的覆盖率。您可以手动对缺失的覆盖率进行申述,也可以使用其他机制,例如覆盖率过滤器或不可达代码信息。
Polyspace 结果
语句覆盖率 | Percentage of statements that current test cases cover (自 R2023b 起) |
条件覆盖率 | Percentage of condition outcomes that current test cases evaluate (自 R2023b 起) |
决策覆盖率 | Percentage of decision outcomes that current test cases cover (自 R2023b 起) |
修正条件/决策覆盖率 (MCDC) | 当前测试用例计算对结果有独立影响的条件的百分比 (自 R2023b 起) |
圈复杂度 | Number of linearly independent paths in function body (自 R2023b 起) |
关系边界覆盖率 | Percentage of relational operations that are tested by current test cases (自 R2023b 起) |
函数覆盖率 | Percentage of unique functions that current test cases execute at least once (自 R2023b 起) |
函数调用覆盖率 | Percentage of function calls that current test cases execute at least once (自 R2023b 起) |
函数出口覆盖率 | Percentage of function exit points that current test cases reach (自 R2023b 起) |
执行时间 | Measures execution time and number of calls for various callable entities of your code (自 R2023b 起) |
内存使用 | Measures stack memory usage of various callable entities of your code (自 R2023b 起) |
工具
| Polyspace 平台设置 | Settings for Polyspace Platform user interface (自 R2023b 起) |
主题
打开结果
- Open Polyspace Results in Polyspace Platform User Interface
See all the ways you can open Polyspace® results.
审查代码覆盖率结果
- 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. - Improve or Justify Missing Code Coverage Results
After reviewing code coverage results, either add tests or justify the missing coverage.
- Compare Code Coverage Results After Adding New xUnit API-Based Tests
After adding new Polyspace Test™ xUnit API based tests, assess the impact of the changes by comparing the coverage results. - Structure of HTML Reports Generated from C/C++ Code Profiling Results
Code profiling reports in HTML format contain a summary of code profiling, along with detailed breakdown per file and function.
审查执行时间结果
- Review and Address Execution Time Results
After calculating the execution time of your code, review the results and address bottlenecks in execution time. - Structure of HTML Reports Generated from C/C++ Code Profiling Results
Code profiling reports in HTML format contain a summary of code profiling, along with detailed breakdown per file and function.
审查内存使用结果
- Review and Address Memory Use Results
After calculating the stack memory use of your code, review the results and address possible stack overflow. - Structure of HTML Reports Generated from C/C++ Code Profiling Results
Code profiling reports in HTML format contain a summary of code profiling, along with detailed breakdown per file and function.
审查代码清理器结果
- 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. - Structure of HTML Reports Generated from C/C++ Code Sanitizer Results
Code sanitization reports in HTML format contain a summary of code profiling, along with detailed breakdown per file, function and flagged expression.
Polyspace Access 工作流
- 将结果上传到 Polyspace Access
从桌面端或服务器端产品上传分析结果。 - 从 Polyspace Access Web 界面创建 Bug 跟踪工具工单 (Polyspace Access)
使用 Jira 软件或 Redmine 从 Polyspace Access 界面跟踪检查结果。