360 Secure SkillHub
360 安全技能中心

Test Coverage Enforcer / 测试覆盖率强制器

面向测试覆盖率的开发类 Skill:宣称扫描代码库、识别未测试逻辑分支,自动生成带夹具的单元测试桩,并支持覆盖率门禁与 CI/CD 集成。材料仅含 SKILL.md,未提供实现脚本或可验证的扫描逻辑,实际能力无法确认。

分类:开发
kingaiwork
kingaiwork
热度 0.00
最近更新 2026-07-08 07:30:30

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add kingaiwork/test-coverage-enforcer
兼容性
通用兼容
联网要求
联网要求未确认
数据出网
数据出网未确认
Metadata
name
test-coverage-enforcer
description
Scan codebase, identify untested paths, and auto-generate unit test stubs with realistic fixtures. / 扫描代码库,识别未测试路径并自动生成带真实夹具的单元测试桩。
version
1.0.0
topics
["testing","code-coverage","unit-tests","test-generation","测试覆盖","自动化测试"]
metadata
{"openclaw":{"requires":{"bins":["bash","curl"]},"emoji":"🧪","homepage":"https://kingai.work/","install":[]}}

🧪 Test Coverage Enforcer / 测试覆盖率强制器

Scan codebase, identify untested paths, and auto-generate unit test stubs with realistic fixtures. / 扫描代码库,识别未测试路径并自动生成带真实夹具的单元测试桩。

🦁 由 KingAI.Work 出品 — 智能进化|vip@kingai.work


Features / 功能特性

• Scans entire codebase to map untested logic branches and conditionals / 全面扫描代码库,精准锁定未测试的逻辑分支与条件判断,让每一次提交都高枕无忧 • Auto-generates unit test stubs with realistic fixtures and mock data / 自动生成含真实数据夹具的单元测试桩,减少手动编写时间高达80% • Analyzes test coverage gaps in real-time, highlighting critical code paths / 实时分析测试覆盖缺口,高亮关键风险路径,确保核心功能零遗漏 • Integrates seamlessly with CI/CD pipelines to enforce coverage gate rules / 无缝集成CI/CD流水线,自动执行覆盖率门禁,防止低质量代码合入 • Detects redundant or brittle tests and suggests optimization patches / 识别冗余或脆弱测试并建议优化补丁,Pro版更提供一键重构方案 • Generates regression test suites for modified code blocks, Pro users get cross-project analysis / 为修改代码块生成回归测试套件,Pro版解锁跨项目依赖分析与智能扩展

Quick Start / 快速开始

bash npx test-coverage-enforcer scan --dir src --min-coverage 80 Scan the source directory with 80% minimum coverage threshold and auto-generate missing test stubs. / 扫描src目录并设置80%最小覆盖率阈值,自动生成缺失的测试桩文件。 

Use Cases / 使用场景

• A senior developer spent hours writing edge-case tests for a payment module. This tool scanned the module and auto-generated 15 test stubs, cutting manual effort by 90%. / 一位高级开发者为支付模块编写边缘测试耗时数小时,该工具扫描模块后自动生成15个测试桩,手动工作量削减90%。 • A startup’s CI pipeline frequently fails due to coverage drops. The enforcer enforces a 75% gate, blocking merges and auto-providing missing tests. / 某初创公司CI流水线因覆盖率下降频繁失败,强制器设置75%门槛,阻止合并并自动提供缺失测试。 • A legacy project had 40% coverage with no documentation. The tool scanned the entire codebase, identified 300 untested paths, and generated stubs with mock data for rapid onboarding. / 遗留项目覆盖率为40%且无文档,工具扫描整个代码库识别300个未测试路径,生成含模拟数据的桩文件,加速新成员上手。

Plans / 方案对比

Feature Free Pro
Core / 核心功能 ✅ ✅
Batch / 批量处理 — ✅
AI / AI 增强 — ✅
Support / 支持 Community Priority

• Unlock cross-repository dependency analysis for complex microservice architectures / 解锁跨仓库依赖分析,专为复杂微服务架构设计,让测试覆盖无盲区 • Gain priority access to premium auto-fix algorithms that reduce false positives by 60% / 获取高级自动修复算法优先权,误报率降低60%,节省团队排查时间 • Activate team dashboards with historical trend tracking and compliance reports / 激活团队仪表盘,含历史趋势追踪与合规报告,从源头把控代码质量\n\n

📦 Published by King AI — kingai.work