Community编程与开发github.com

提出特性测试计划

根据EARS需求和关键约束创建测试计划,将需求映射到具体测试。

提出特性测试计划 是什么?

该技能用于系统地将特性需求和关键约束(Critical Constraints)转化为可执行的测试计划。它引导用户从已有的概念、需求和设计文档中提取所有REQ-*标识符和CC-*关键约束,并生成结构化的 test-plan.md 文件。该文件涵盖测试类型分类(单元、集成、不可测试、超出范围)、需求覆盖率表格、关键约束验证方法以及集成测试(尤其是CLI程序)的具体要求。它还提供了验证命令和常见问题排查指南,确保每个需求和约束都有明确的验证方式。此技能适用于设计文档已完成后、实施前的测试规划阶段,支持遵循文档驱动开发流程的项目。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/cbgbt/bottlerocket-forest/tree/main/skills/propose-feature-test-plan

Installed? Explore more 编程与开发 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

提出特性测试计划技能

目的

创建一个测试计划,将需求和约束系统地映射到具体的测试上。这确保每个需求都有验证手段,并指导测试的实现。

何时使用

  • 存在包含关键约束的设计文档
  • 在实施前准备规划测试方法
  • 需要记录哪些测试将验证哪些需求

前提条件

  • 特性概念文件存在于 ./docs/features/NNNN-feature-name/concept.md
  • 需求文件存在于 ./docs/features/NNNN-feature-name/requirements.md
  • 设计文件存在于 ./docs/features/NNNN-feature-name/design.md(包含关键约束)

步骤

1. 确认前提条件存在

ls ./docs/features/NNNN-feature-name/concept.md
ls ./docs/features/NNNN-feature-name/requirements.md
ls ./docs/features/NNNN-feature-name/design.md

如果其中任何一个文件不存在,请先完成相应步骤。

2. 提取需求与约束

审查 requirements.md 中的所有 REQ-* 标识符。 审查 design.md 中的所有 CC-* 关键约束。

3. 创建测试计划文件

创建 ./docs/features/NNNN-feature-name/test-plan.md,结构如下:

# 测试计划:特性名称

## 概述

简要描述测试方法。

## 测试类型

- **单元测试**:隔离测试内部逻辑,允许 mock
- **集成测试**:接触真实外部资源(文件系统、网络),不允许 mock
- **不可测试**:无法通过自动化测试验证(解释原因)
- **超出范围**:需要外部认证——记录下来但不要实施

## 需求覆盖

| 需求编号 | 测试类型 | 测试名称 | 描述 |
|----------|----------|----------|------|
| REQ-1  | unit      | test_xxx  | 它验证的内容 |
| REQ-2  | integration | test_yyy | 它验证的内容 |
| REQ-3  | not-testable | - | 为什么不可测试 |
| REQ-4  | out-of-scope | - | 为什么超出范围 |

## 关键约束验证

| 约束编号 | 验证方法 | 测试名称 |
|----------|----------|----------|
| CC-1  | 如何验证该约束 | test_xxx |

## 集成测试要求

对于 CLI 程序,集成测试必须:
- 运行用户实际使用的 CLI 二进制文件/命令
- 不直接测试内部 API
- 执行用户/客户将实际执行的操作

## 测试实现说明

实施这些测试的任何具体指导。

4. 映射每个需求

对于 requirements.md 中的每个 REQ-*:

  1. 确定测试类型:

    • 单元测试:内部逻辑、算法、数据转换
    • 集成测试:文件 I/O、网络调用、CLI 命令、外部进程
    • 不可测试:无法自动化(例如,主观质量、需要人工判断、设置不可行)
    • 超出范围:需要与外部系统进行认证(云 API、需要认证的注册表)
  2. 为测试命名(例如 test_parses_valid_config)

  3. 简要描述它验证的内容

5. 映射每个关键约束

对于 design.md 中的每个 CC-*:

  1. 描述如何验证该约束
  2. 链接到强制执行该约束的特定测试名称
  3. 如果约束需要代码审查而非自动化测试,请注明

6. 记录 CLI 测试方法

如果特性包含 CLI 命令:

  • 集成测试应运行实际的二进制文件
  • 捕获 stdout/stderr 进行验证
  • 端到端测试真实的用户工作流
  • 不要 mock CLI 层

7. 标记超出范围的测试

对于需要外部认证的测试:

  1. 记录将要测试什么
  2. 解释为什么超出范围
  3. 注明任何手动验证步骤

验证

# 检查文件是否存在
ls ./docs/features/NNNN-feature-name/test-plan.md

# 验证所有需求都被覆盖
grep -c "REQ-" ./docs/features/NNNN-feature-name/test-plan.md
grep -c "REQ-" ./docs/features/NNNN-feature-name/requirements.md
# 数目应大致相当

# 验证所有约束都被覆盖
grep -c "CC-" ./docs/features/NNNN-feature-name/test-plan.md
grep -c "CC-" ./docs/features/NNNN-feature-name/design.md
# 数目应大致相当

常见问题

缺失覆盖:每个 REQ-* 和 CC-* 都必须出现在测试计划中。使用验证 grep 命令检查。

错误的测试类型:单元测试不应接触文件系统/网络。集成测试不应使用 mock。

测试内部实现而非行为:对于 CLI 工具,测试用户运行的 CLI 命令,而不是内部函数。

描述模糊:测试描述应说明验证的具体行为。

后续步骤

创建测试计划后:

  1. 与相关方审查覆盖范围
  2. 继续使用“提出实施计划”技能规划实施
  3. 实施计划应引用 test-plan.md 中的测试要求

Individual skills in this repo

This repo contains 19 individual skills — each has its own dedicated page.

ad-hoc-implementation-plan

Transform a rough plan into implement-commit ready artifacts. Allows rigorous review while implementing.

build-kit-locally

Build a kit and publish it to a locally hosted registry for development testing

build-variant-from-local-kits

Build a variant using locally published kits for development validation

deep-research

Create educational documents that build understanding progressively with citations

edit-spec-file

Edit Bottlerocket RPM spec files following project style conventions

fact-find

Quick lookup of specific facts about Bottlerocket with citations

idea-honing

Clarify feature ideas through iterative Q&A, recording insights to guide concept development

implement-commit

Implement commits from an implementation plan using a TDD pipeline

local-registry

Start and manage a local OCI registry for Bottlerocket kit development

prepare-core-kit-release

Prepare bottlerocket-core-kit for release by bumping version and updating changelog

propose-feature-concept

Create a new feature concept document to pitch the idea and explain the problem/solution

propose-feature-design

Create or update feature technical design document with architecture and implementation guidance

propose-feature-requirements

Create or update feature requirements specification using EARS notation with examples and appendices

propose-implementation-plan

Create an implementation plan with atomic commits that build toward a complete feature

review-code

Deep code review generating PR comments via principled question-driven analysis

review-scope

Verify code changes match intended scope and requirements without exceeding boundaries

review-style

Verify code follows project style guides without providing improvement suggestions

test-local-twoliter

Build and test local changes to twoliter before releasing

update-twoliter

Update all Bottlerocket repositories to a new Twoliter version

相关技能