🎯 Code Coverage Gap Finder / 代码覆盖率缺口查找器
Compare coverage reports to identify untested critical paths and generate test cases. / 对比覆盖率报告,识别未测试的关键路径并生成测试用例。
🦁 由 KingAI.Work 出品 — 智能进化|vip@kingai.work
Overview / 概览
• Identifies untested critical paths across multiple coverage reports in seconds / 在数秒内跨多份覆盖率报告,精准定位未被覆盖的关键业务路径 • Generates ready-to-run test cases directly from code coverage gaps / 直接从覆盖率缺口生成可即用的测试用例,大幅减少手工编写量 • Visual comparison of branch and line coverage side by side / 左右对比分支覆盖与行覆盖数据,一眼看清测试盲区 • Integrates with CI pipelines to flag coverage drops automatically / 与CI流水线集成,自动标记覆盖率下降,防范回归风险 (Pro only) • Exports detailed gap analysis reports with risk severity levels / 导出包含风险严重度分级的详细缺口分析报告,为决策提供依据 • Provides strategic test recommendations based on historical code changes / 基于历史代码变更提供策略性测试建议,提前锁定高危险区域 (Pro only)
How It Works / 原理
# Step 1 — check environment
which bash curl && echo "Ready"
# Step 2 — run the tool
bash coverage-gap-finder --before cobertura.old.xml --after cobertura.new.xml --critical Run a diff between two Cobertura reports, focusing only on critical paths that lost coverage. / 对比两份Cobertura报告,仅显示丧失覆盖的关键路径。
# Step 3 — review output
echo "Done — check the generated output"
Example Scenarios / 示例场景
• A release build shows 85% line coverage, but gap analysis reveals 3 untested authentication branches that could crash under load. / 发布构建显示85%的行覆盖率,但缺口分析暴露出3个未测试的身份验证分支,在高负载下可能导致系统崩溃。 • After a large refactor, the team needs to know exactly which new code paths remain uncovered before merging. / 大型重构后,团队需要在合并前精确了解哪些新代码路径尚未被覆盖。 • A developer wants to automatically generate test cases for a recently discovered gap in the payment module. / 开发者希望自动为支付模块中最新发现的缺口生成测试用例。
Plans / 版本
| Capability | Free | Pro |
|---|---|---|
| Basics / 基础 | ✅ | ✅ |
| Automation / 自动化 | — | ✅ |
| AI / AI 功能 | — | ✅ |
| Support | Community | Priority |
• Unlock automatic test case generation for any identified gap, saving hours of manual work. • 解锁针对任何已识别缺口的自动测试用例生成,节省数小时手工编写时间。 • Get access to historical trend analysis to see how coverage evolves over time. • 获取历史趋势分析功能,掌握覆盖率随时间的变化规律。 • Enable CI integration to block builds that introduce critical untested paths. • 启用CI集成,阻止引入关键未测试路径的构建。\n\n
Published by King AI — kingai.work
