review-test-coverage
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTest Coverage Review
测试覆盖率评审
Review code from a testing perspective.
从测试视角评审代码。
Review Checklist
评审检查清单
Unit Test Coverage
单元测试覆盖率
- Verify all public functions have unit tests
- Check boundary conditions and edge cases are tested
- Look for missing null/empty/error path tests
- Verify assertions are meaningful (not just "no exception thrown")
- 验证所有公开函数均有对应的单元测试
- 检查边界条件和边缘场景是否已覆盖测试
- 排查是否存在空值/空输入/错误路径的测试缺失
- 验证断言具备实际意义(而非仅断言“未抛出异常”)
Integration Test Coverage
集成测试覆盖率
- Check critical user flows have integration tests
- Verify API endpoints are tested end-to-end
- Look for missing database interaction tests
- Check external service integration points
- 检查关键用户流程是否有集成测试覆盖
- 验证API端点是否经过端到端测试
- 排查是否缺失数据库交互测试
- 检查外部服务集成点的测试情况
Test Quality
测试质量
- Verify tests are independent (no shared mutable state)
- Check test naming clearly describes the scenario
- Look for flaky tests (timing, ordering, external dependencies)
- Verify proper use of mocks/stubs (not over-mocking)
- 验证测试相互独立(无共享可变状态)
- 检查测试命名能清晰描述对应场景
- 排查不稳定测试(受计时、执行顺序、外部依赖影响的测试)
- 验证mocks/stubs的合理使用(避免过度模拟)
Edge Cases & Error Handling
边界场景与错误处理
- Check error paths are tested (exceptions, failures)
- Verify timeout and retry behavior is tested
- Look for race condition tests in concurrent code
- Check boundary values (0, -1, MAX, empty, null)
- 检查错误路径是否已测试(异常、故障场景)
- 验证超时与重试行为是否已测试
- 排查并发代码中的竞态条件测试情况
- 检查边界值(0、-1、最大值、空值、Null)的测试覆盖
Test Maintainability
测试可维护性
- Verify test helpers/fixtures reduce duplication
- Check tests don't depend on implementation details
- Look for proper setup/teardown handling
- Verify test data is clear and self-documenting
- 验证测试辅助工具/测试夹具是否减少了代码重复
- 检查测试是否不依赖于实现细节
- 排查是否有合适的初始化/清理处理
- 验证测试数据清晰且具备自文档性
Output Format
输出格式
Report findings with priority:
| Priority | Description |
|---|---|
| Missing | Critical path without any test coverage |
| Incomplete | Test exists but misses important cases |
| Quality | Test exists but has quality issues |
| Enhancement | Additional test would improve confidence |
按优先级整理并报告发现的问题:
| 优先级 | 描述 |
|---|---|
| 缺失 | 关键路径完全无测试覆盖 |
| 不完整 | 已有测试但遗漏重要场景 |
| 质量问题 | 已有测试但存在质量缺陷 |
| 优化建议 | 添加额外测试可提升信心 |