360 Secure SkillHub
360 安全技能中心

Unit Test Coverage Helper

核心功能:针对代码库识别高价值测试用例,按现有风格编写单元测试,生成优先级测试计划,验证覆盖率并说明缺口。典型场景:需提升单元测试覆盖率、为bug添加回归测试、重构前做特性测试。输入为代码库信息、需求描述,输出含测试计划、测试代码、验证命令及覆盖缺口说明,适用于软件维护者、QA工程师等需回归信心的用户。

kyro-ma
kyro-ma
热度 16.02
最近更新 2026-06-23 12:34:34
分类:开发依赖:代码执行 / 读写文件 / 内部调用大模型应用场景:代码生成 / 调试排错 / DevOps

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add unit-test-coverage-helper-040526
Metadata
name
unit-test-coverage-helper
description
Add meaningful unit tests to existing codebases by finding uncovered behavior, selecting high-value cases, and validating coverage without brittle test inflation. Use when a user asks for unit tests, coverage, regression, pytest, jest, or needs practical workflow, code, checklist, documentation, or review support for this job.

Unit Test Coverage Helper

Purpose

Use this skill when a project needs better unit coverage, regression tests for a bug, characterization tests before refactoring, or a coverage plan that prioritizes behavior over vanity percentages.

Audience: software maintainers, QA engineers, open-source contributors, and product teams that need regression confidence from practical tests.

Read references/requirement-plan.md when demand evidence, source links, scoring rationale, or review criteria are needed.

Workflow

  1. Inspect the language, framework, test runner, coverage command, existing test style, and code paths or bug reports that motivated the request.
  2. Identify high-value cases: pure functions, boundaries, errors, serialization, permissions, state transitions, and previously broken behavior.
  3. Write tests in the repository's existing style with realistic fixtures and minimal mocking.
  4. Add regression cases before broad coverage cases when a specific bug or incident exists.
  5. Run the focused test command first, then the broader suite or coverage command when cost is acceptable.
  6. Report coverage movement, uncovered risk, and any production changes needed to make testing clean.

Expected Outputs

  • A prioritized test plan for uncovered or risky paths.
  • Concrete unit test files or patches that follow local conventions.
  • Focused and broad verification commands.
  • A short explanation of remaining coverage gaps and why they matter.

Validation

  • Tests assert behavior, edge cases, and regressions instead of implementation trivia.
  • The requested test runner or equivalent focused command passes locally.
  • Mocks and fixtures are small, readable, and consistent with the codebase.
  • Coverage improvement is described honestly, including areas left untested.

Triggers

Keywords: unit tests, coverage, regression, pytest, jest, test plan, quality

Example trigger sentences:

  • Use $unit-test-coverage-helper to add regression tests for this bug fix.
  • Find the highest-value unit tests to raise coverage in this module.
  • Create a coverage plan before refactoring this service.