Test Coverage Findings: PR {number}
2026/9/13 14:49:42 网站建设 项目流程

Test Coverage Findings: PR #{number}

【免费下载链接】ArchonThe first open-source harness builder for AI coding. Make AI coding deterministic and repeatable.项目地址: https://gitcode.com/GitHub_Trending/archon3/Archon

Reviewer: test-coverage-agentDate: {ISO timestamp}Source Files: {count}Test Files: {count}

#### Summary 与 Verdict ```markdown ## Summary {2-3 sentence overview of test coverage quality} **Verdict**: {APPROVE | REQUEST_CHANGES | NEEDS_DISCUSSION}

结论三选一:APPROVE(覆盖充分,放行)、REQUEST_CHANGES(存在必须补齐的缺口)、NEEDS_DISCUSSION(需要人工讨论,例如实现本身存在争议)。

Coverage Map 覆盖映射表
## Coverage Map | Source File | Test File | New Code Tested | Modified Code Tested | |-------------|-----------|-----------------|---------------------| | `src/x.ts` | `src/x.test.ts` | FULL/PARTIAL/NONE | FULL/PARTIAL/NONE | | `src/y.ts` | (missing) | N/A | N/A |

每个源文件一行,测试文件列给出对应测试(缺失则标注(missing)),新增代码与修改代码分别用FULL/PARTIAL/NONE标注覆盖程度。这是整份报告的「地图」,让读者一眼看到哪些文件无人值守。

Findings 发现条目(核心)
## Findings ### Finding 1: {Descriptive Title} **Severity**: CRITICAL | HIGH | MEDIUM | LOW **Category**: missing-test | weak-test | implementation-coupled | missing-edge-case **Location**: `{file}:{line}` (source) / `{test-file}` (test) **Criticality Score**: {1-10}

每个 Finding 的字段设计:

  • Severity:四档严重度(CRITICAL / HIGH / MEDIUM / LOW);
  • Category:缺口类型分类——missing-test(完全缺测试)、weak-test(测试太弱)、implementation-coupled(测试与实现耦合)、missing-edge-case(缺少边界用例);
  • Location:源文件位置 + 测试文件位置双定位;
  • Criticality Score:1–10 的量化评分,供后续统计与排序。
Issue 描述与未测试代码
**Issue**: {Clear description of the coverage gap} **Untested Code**: ```typescript // This code at {file}:{line} is not tested {untested code}
**Why This Matters** 部分要求给出「如果……用户会看到……」「未来对 X 的修改可能在不被察觉的情况下破坏 Y」这类**具体后果推演**,避免空泛的"缺少测试"式评论: ```markdown **Why This Matters**: {Specific bugs or regressions this could miss: - "If {scenario}, users would see {bad outcome}" - "A future change to {X} could break {Y} without detection"}

这与 review-tests.md 的「一个 finding 必须包含四要素」(行为或不变量 / 覆盖映射 / 可信回归 / 最小有价值的测试)要求完全同构——先命名可观测的失败,再谈缺哪行测试

测试建议选项表
#### Test Suggestions | Option | Approach | Catches | Effort | |--------|----------|---------|--------| | A | {test approach} | {what it catches} | LOW/MED/HIGH | | B | {alternative} | {what it catches} | LOW/MED/HIGH | **Recommended**: Option {X}

每个缺口给出至少两个候选测试方案,各自标注能捕获什么、工作量多高,然后基于以下理由推荐其一:

  • 与代码库既有测试模式一致(Matches codebase test patterns)
  • 测行为而非实现(Tests behavior not implementation)
  • 成本收益比良好(Good cost/benefit ratio)
  • 能捕获最关键的失败(Catches the most critical failures)
推荐测试代码(可直接复用)
describe('{feature}', () => { it('should {expected behavior}', () => { // Arrange {setup} // Act {action} // Assert {assertions} }); it('should handle {edge case}', () => { // Test edge case }); });

模板按 Arrange / Act / Assert 三段式组织,并强制同时覆盖正常行为与边界情况两个it用例——这本身就是「行为测试 + 边界用例」的规范样例。

代码库模式引用
**Test Pattern Reference**: ```typescript // SOURCE: {test-file}:{lines} // This is how similar functionality is tested {existing test from codebase}

【免费下载链接】ArchonThe first open-source harness builder for AI coding. Make AI coding deterministic and repeatable.项目地址: https://gitcode.com/GitHub_Trending/archon3/Archon

创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询