test-strategy
Skill0 starsChanged 12 days agoApache-2.0View on GitHub
制定系统级测试计划时使用。覆盖集成测试、性能测试、安全测试、回归测试策略与 Bug 管理流程,补充 TDD 之外的覆盖。触发词: 测试计划、集成测试、性能测试、回归测试。
- Commits and pushes
44 other projects use a version of this.
Adopted by
Most recently taken up by
- afine907/skillstheir own version, first seen Nov 29, 2026
- ericgandrade/agentic-sdlctheir own version, first seen Nov 29, 2026
- l-gevity/l-gevity-skillstheir own version, first seen Nov 22, 2026
- parvez3019/ai-coding-microservices-skillstheir own version, first seen Nov 22, 2026
- meaningfy-ws/skillerytheir own version, first seen Nov 16, 2026
- swap-cameroon/kuro-antigravity-configtheir own version, first seen Nov 15, 2026
Used with
Projects with it also use database-testing, exploratory-testing and 9 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
petrkindlmannSkilldatabase-testing
Validate database integrity, test migrations forward and backward, verify schema constraints, manage seed data, detect migration drift, and identify query performance issues. Covers PostgreSQL, MySQL, MongoDB with Prisma, TypeORM, Drizzle, and SQLAlchemy, plus Testcontainers test databases. Use when: "database test," "migration test," "migration rollback," "rollback test," "data integrity," "SQL test," "schema validation," "seed data," "query performance," "Testcontainers." Not for: synthetic data generation/masking at scale — use test-data-management; Docker/IaC test-environment provisioning — use test-environments; SQL injection — use security-testing. Related: test-data-management, test-environments, security-testing, ci-cd-integration.
Also in 3 projects that use this
testified-ossSkillexploratory-testing
Guide exploratory testing sessions including charter creation, session-based testing, heuristics application, and finding documentation. Use when planning exploratory testing, conducting test sessions, or documenting discoveries.
Also in 4 projects that use this
jayavibhavnkSkilldata-pipelines
Build ETL/data pipelines - extract, transform, load with proper error handling and monitoring.
Also in 3 projects that use this
petrkindlmannSkillcontract-testing
Implement consumer-driven contract testing with Pact-JS (v16). Covers consumer test writing, broker-driven provider verification, Pact Broker setup, can-i-deploy as a deployment gate, webhook-triggered verification, pending pacts, and schema-first vs consumer-first approaches (OpenAPI/Ajv, Schemathesis). Use when: "contract test," "Pact," "consumer-driven," "API contract," "provider verification," "can-i-deploy." Not for: stubbing or mocking a dependency to isolate a test — use service-virtualization; general REST/GraphQL endpoint assertions against your own API — use api-testing. Related: api-testing, service-virtualization, ci-cd-integration, test-environments.
Also in 3 projects that use this
mahsumaktasSkillverification-gate
Verification gate before claiming task completion. No completion claim without fresh evidence.
Also in 3 projects that use this
ffsshhttiikkSkillunit-testing
Unit testing best practices and patterns
Also in 4 projects that use this
Other versions44 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 44
- nurettincoban/ai-prd-workflow★ 317same name
- petrkindlmann/qa-skills★ 274same name
- kid-sid/claude-spellbook★ 190same name
- avelikiy/great_cto★ 115same name
- ericgandrade/agentic-sdlc★ 109same name
- l-gevity/l-gevity-skills★ 93same name
- fishzjp/qa-skills★ 64same name
- nahid-sparktales/agent-dispatcher★ 59same name
- nimadorostkar/Claude-Skills-collection★ 41same name
- caiaffa/claude-code-ultimate-engineering-system★ 17same name
34 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository29 other files it gives its agents.
- AGENTS.mdAGENTS.md
- ai-safety-checkSkill
- analytics-designSkill
- api-designSkill
- brainstormingSkill
- code-reviewSkill
- database-migrationSkill
- data-flow-designSkill
- deploySkill
- executing-plansSkill
- finishing-branchSkill
- frontend-componentSkill
- git-commitSkill
- html-document-centerSkill
- i18n-designSkill
- integration-designSkill
- ops-monitoringSkill
- performance-tuningSkill
- project-closureSkill
- project-initiationSkill
- refactoringSkill
- security-designSkill
- systematic-debuggingSkill
- system-designSkill
- test-driven-developmentSkill
- ui-designSkill
- verificationSkill
- writing-plansSkill
- writing-skillsSkill
The file
Files
Test Strategy
负责代理
test-engineer — 测试策略制定和系统级测试由测试工程师代理负责,覆盖测试分层、用例设计、Bug 管理和测试报告。
何时使用
- 单元测试(TDD)完成后,需要进行系统级测试时
- 需要制定测试计划、测试范围和排期时
- 需要进行集成测试、性能测试、安全测试、回归测试时
- 需要建立 Bug 管理流程时
- 版本发布前,需要系统化测试验收时
触发关键词: "测试计划"、"集成测试"、"性能测试"、"安全测试"、"回归测试"、"Bug管理"、"测试报告"
与其他技能的关系
brainstorming → system-design → test-strategy(设计阶段)
↓
executing-plans → test-strategy(执行阶段)
↓
verification(完成前验证)衔接规则:
test-strategy分为两个阶段:
- 设计阶段:在编码前输出
test-design.md,定义测试分层、自动化策略和覆盖目标- 执行阶段:在编码完成后按设计文档执行测试
执行流程
Phase 0: 设计阶段(输出 test-design.md)
目标: 在编码前完成测试方案设计,确保测试覆盖率和自动化策略。
Step 1: 测试分层定义
根据项目技术栈定义测试金字塔:
| 测试层 | 范围 | 工具 | 覆盖率目标 | 运行频率 |
| 单元测试 | 函数/类/方法 | Pytest / Jest | >= 80% | 每次提交 |
| 集成测试 | 模块间交互 | Pytest + TestClient | >= 60% | 每次 PR |
| API 测试 | 接口契约 | Pytest + httpx | 100% 接口 | 每次部署 |
| E2E 测试 | 核心用户流程 | Playwright / Cypress | >= 5 条核心路径 | 每次发布 |
| 性能测试 | 响应时间/并发 | Locust / k6 | 基线达标 | 每次大版本 |
| 安全测试 | OWASP Top 10 | 手动 + 工具 | 关键项全覆盖 | 每次发布 |
Step 2: 自动化测试策略
定义 CI/CD 中的测试流水线:
Git Push -> Lint -> 单元测试 -> 构建 -> 集成测试 -> API测试 -> E2E测试 -> 部署测试数据管理:
- 使用 Fixtures / Factories 生成测试数据
- 每个测试用例独立,不依赖执行顺序
- 集成测试使用独立数据库(Docker)
- Mock 外部服务(支付、邮件、SMS)
Step 3: 测试用例清单
列出核心功能的测试用例(按模块):
| 模块 | 测试用例 | 类型 | 优先级 |
| 认证 | 登录成功 | 集成 | P0 |
| 认证 | 密码错误 | 集成 | P0 |
| 认证 | Token过期 | 单元 | P0 |
| 用户 | 获取个人信息 | 集成 | P0 |
| ... | ... | ... | ... |
Step 4: 覆盖率目标与门禁
| 类型 | 目标 | 门禁(不达标则阻止合并) |
| 行覆盖率 | >= 80% | >= 70% |
| 分支覆盖率 | >= 70% | >= 60% |
| 核心模块 | >= 90% | >= 85% |
Step 5: 输出 test-design.md
文件保存到 docs/test-design.md:
# 测试设计: [项目名称]
## 1. 测试分层与策略
### 1.1 测试金字塔
### 1.2 CI/CD 流水线
## 2. 测试用例清单
### 2.1 认证模块
### 2.2 用户模块
...
## 3. 测试数据管理
## 4. 覆盖率目标
## 5. Mock/Stub 策略Phase 1: 测试计划制定
目标: 明确测试范围、策略和排期。
输出文档 docs/test-plan.md:
# 测试计划: [版本/功能名称]
## 1. 测试范围
### In Scope
### Out of Scope
## 2. 测试策略
| 测试类型 | 范围 | 负责人 | 预计工时 |
|----------|------|--------|----------|
| 集成测试 | | | |
| 性能测试 | | | |
| 安全测试 | | | |
| 兼容性测试 | | | |
| 回归测试 | | | |
## 3. 测试环境
- 开发环境:
- 测试环境:
- 预发布环境:
## 4. 验收标准
- 功能验收:
- 性能验收:
- 安全验收:
## 5. 风险与应对Phase 2: 测试用例编写
目标: 为每个测试维度编写具体用例。
- 集成测试用例
- 覆盖模块间交互(API → Service → Repository → DB)
- 覆盖跨模块数据流(如:用户注册 → 发送邮件 → 记录日志)
- 覆盖第三方服务集成(Mock + 真实调用)
性能/压力测试方案
- 定义性能指标基线:
- API 响应时间 P99 < ?ms
- 并发用户数支持 ?
- 吞吐量 ? req/s
- 设计压测场景:逐步加压 / 持续高压 / 峰值冲击
- 工具选择:locust / k6 / Apache Bench
[技术栈条件] 性能测试工具和指标基线由项目
tech-stack.md定义。- 定义性能指标基线:
- 安全测试检查清单
- 输入校验:SQL 注入、XSS、CSRF
- 认证授权:越权访问、Token 过期、权限提升
- 敏感数据:日志泄露、响应体泄露、传输加密
- 依赖安全:已知漏洞扫描(pip-audit / npm audit)
- 兼容性测试
- 浏览器兼容性(如适用)
- API 版本兼容性
- 数据库迁移兼容性
- 回归测试策略
- 全量回归:每次大版本发布
- 选择性回归:基于变更影响范围选择用例
- 自动化回归:将核心路径测试自动化
Phase 3: 测试执行
- 按计划执行各类型测试
- 记录测试结果
- 发现 Bug 时进入 Bug 管理流程
Phase 4: Bug 管理
Bug 生命周期:
发现 → 提交 → 分配 → 修复 → 验证 → 关闭
↓
重新打开(验证失败)Bug 分级标准:
| 级别 | 定义 | 响应时间 | 示例 |
| P0 - 阻塞 | 核心功能不可用,无规避方案 | 立即修复 | 登录失败、数据丢失、支付报错 |
| P1 - 严重 | 核心功能受损,有规避方案 | 24h 内修复 | 搜索结果错误、特定浏览器崩溃 |
| P2 - 一般 | 非核心功能异常 | 本迭代修复 | 样式错位、文案错误 |
| P3 - 轻微 | 体验问题,不影响功能 | 下迭代修复 | 动画卡顿、对齐不齐 |
Bug 记录模板:
## Bug #[编号]
- **标题**: [简洁描述]
- **级别**: P0/P1/P2/P3
- **环境**: [测试/预发布/生产]
- **复现步骤**:
1.
2.
3.
- **预期结果**:
- **实际结果**:
- **截图/日志**: [附附件]
- **指派**: [开发者]
- **状态**: [新建/修复中/待验证/已关闭/重新打开]Phase 5: 测试报告
测试完成后输出 docs/test-report.md:
# 测试报告: [版本/功能名称]
## 1. 测试概要
- 测试周期: YYYY-MM-DD ~ YYYY-MM-DD
- 测试范围: [简述]
- 测试环境: [环境]
## 2. 测试结果汇总
| 测试类型 | 用例数 | 通过 | 失败 | 阻塞 | 通过率 |
|----------|--------|------|------|------|--------|
| 集成测试 | | | | | |
| 性能测试 | | | | | |
| 安全测试 | | | | | |
| 回归测试 | | | | | |
## 3. 性能测试结果
- API 响应时间: P50=?ms, P95=?ms, P99=?ms
- 并发支持: ? 并发用户
- 吞吐量: ? req/s
- 结论: [达标/不达标]
## 4. 缺陷统计
| 级别 | 数量 | 已修复 | 待修复 |
|------|------|--------|--------|
| P0 | | | |
| P1 | | | |
| P2 | | | |
| P3 | | | |
## 5. 遗留问题与风险
## 6. 测试结论
- [ ] 通过,可发布
- [ ] 有条件通过(遗留 P2/P3 问题)
- [ ] 不通过(存在 P0/P1 未修复)硬性规则
- ✅ 测试计划必须在开发前制定 — 不是写完代码才想怎么测
- ✅ 性能测试必须定义量化基线 — "性能还行"不是结论
- ✅ 安全测试必须覆盖 OWASP Top 10 — 至少检查注入、XSS、CSRF
- ✅ Bug 必须分级管理 — P0/P1 必须在发布前修复
- ✅ 测试报告必须包含量化数据 — 通过率、响应时间、并发数
- ✅ 回归测试必须自动化核心路径 — 手动回归不可持续
- ❌ 禁止跳过安全测试直接上线
- ❌ 禁止 P0/P1 Bug 未修复就发布
- ❌ 禁止测试报告只写"测试通过"无数据支撑
反模式
- ❌ "开发完了随便测测" — 没有计划的测试等于没测
- ❌ 只测 Happy Path — 边界条件和异常场景才是 Bug 温床
- ❌ 性能测试只看平均值 — P99 才是用户体验的真实反映
- ❌ Bug 记录只有标题没有复现步骤 — 开发者无法复现就无法修复
- ❌ 安全测试只靠工具扫描 — 工具漏报率高,需人工验证
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

