Skip to content
Back to skills

Test Coverage Assistant

ASecurity

[UDS] 以八維度框架分析程式碼層級的測試覆蓋率,並建議該優先補上哪些缺口。 Use when: 覆蓋率數字看起來很健康但缺陷照樣流出、要在行覆蓋率之外判斷測試完整性、設定覆蓋率目標。 Not for: 需求層級的 AC 與測試追蹤——請用 /ac-coverage;補寫缺少的測試——請用 /tdd 或 /spec-derive。 Keywords: test coverage, eight dimensions, line coverage, branch coverage, test quality, 測試覆蓋率, 八維度, 測試完整性, 覆蓋缺口.

  • 75 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 4, 2026
developmentbash

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 4, 2026

npx -y skills add AsiaOstrich/universal-dev-standards --skill test-coverage-assistant --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Test Coverage Assistant?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Test Coverage Assistant
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/asiaostrich-test-coverage-assistant-universal-dev-standards/badge)](https://www.skillsdirectory.com/skills/asiaostrich-test-coverage-assistant-universal-dev-standards)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: coverage
source: ../../../../skills/test-coverage-assistant/SKILL.md
source_version: 1.1.0
translation_version: 1.2.0
last_synced: 2026-08-17
status: current
description: |
  [UDS] 以八維度框架分析程式碼層級的測試覆蓋率,並建議該優先補上哪些缺口。
  Use when: 覆蓋率數字看起來很健康但缺陷照樣流出、要在行覆蓋率之外判斷測試完整性、設定覆蓋率目標。
  Not for: 需求層級的 AC 與測試追蹤——請用 /ac-coverage;補寫缺少的測試——請用 /tdd 或 /spec-derive。
  Keywords: test coverage, eight dimensions, line coverage, branch coverage, test quality, 測試覆蓋率, 八維度, 測試完整性, 覆蓋缺口.
allowed-tools: Read, Grep, Glob, Bash(npm test:*)
scope: partial
argument-hint: "[file or module | 檔案或模組]"
---

# 測試覆蓋率助手

> **語言**: [English](../../../../skills/test-coverage-assistant/SKILL.md) | 繁體中文

多維度分析測試覆蓋率並提供可執行的建議。

## 覆蓋率維度

| 維度 | 測量內容 | Dimension | What it Measures |
|------|----------|-----------|------------------|
| **行覆蓋率** | 執行的程式碼行數 | Line | Lines of code executed |
| **分支覆蓋率** | 決策路徑覆蓋 | Branch | Decision paths taken |
| **函式覆蓋率** | 呼叫的函數 | Function | Functions called |
| **陳述式覆蓋率** | 執行的陳述式 | Statement | Statements executed |

## 八維度框架

1. **程式碼覆蓋率** - 行、分支、函式
2. **需求覆蓋率** - 所有需求都有對應測試
3. **風險覆蓋率** - 高風險區域優先測試
4. **整合覆蓋率** - 元件互動路徑
5. **邊界案例覆蓋率** - 邊界條件測試
6. **錯誤覆蓋率** - 錯誤處理路徑驗證
7. **權限覆蓋率** - 存取控制場景
8. **AI 生成品質** - AI 生成測試的有效性

## 覆蓋率目標

| 等級 | 覆蓋率 | 適用場景 | Use Case |
|------|--------|----------|----------|
| 最低要求 | 60% | 遺留程式碼 | Legacy code |
| 標準 | 80% | 大多數專案 | Most projects |
| 高標準 | 90% | 關鍵系統 | Critical systems |
| 嚴格 | 95%+ | 安全關鍵 | Safety-critical |

## 工作流程

1. **執行覆蓋率工具** - 產生覆蓋率報告
2. **分析缺口** - 識別未測試的區域
3. **排定優先順序** - 依風險和重要性排序
4. **建議測試** - 提出具體的測試建議
5. **追蹤進度** - 持續監控覆蓋率變化

## 使用方式

- `/coverage` - 執行完整覆蓋率分析
- `/coverage src/auth` - 分析特定模組
- `/coverage --recommend` - 取得測試建議

## 下一步引導

`/coverage` 完成後,AI 助手應建議:

> **覆蓋率分析完成。建議下一步:**
> - 覆蓋率不足 → 執行 `/tdd` 補齊測試
> - 已達標 → 執行 `/checkin` 品質關卡
> - 發現熱點 → 執行 `/refactor` 改善可測試性

## 參考

- 詳細指南:[guide.md](./guide.md)
- 核心規範:[test-completeness-dimensions.md](../../../../core/test-completeness-dimensions.md)

Files in this skill

  • SKILL.md3 KB
  • guide.md8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…