Agent Skills
› cosmicstack-labs/mercury-agent-skills
› test-strategy
test-strategy
GitHub提供全面测试策略设计指南,涵盖现代测试金字塔分层、基于风险的测试方法、覆盖率目标设定、测试计划模板及CI集成规范,旨在早期发现缺陷并支持产品规模化。
Trigger Scenarios
制定或优化项目测试策略
设计测试金字塔架构
评估和设定代码覆盖率目标
规划基于风险的测试优先级
配置CI/CD中的自动化测试流程
Install
npx skills add cosmicstack-labs/mercury-agent-skills --skill test-strategy -g -y
SKILL.md
Frontmatter
{
"name": "test-strategy",
"metadata": {
"tags": [
"testing",
"strategy",
"qa",
"quality",
"automation"
],
"author": "cosmicstack-labs",
"version": "1.0.0",
"category": "testing-qa"
},
"description": "Test pyramid, risk-based testing, test planning, coverage metrics, and SDLC integration"
}
Test Strategy
Design comprehensive test strategies that catch bugs early and scale with your product.
The Modern Test Pyramid
E2E (5%)
Integration (15%)
Component/Contract (30%)
Unit Tests (50%)
Layer Details
| Layer | Scope | Speed | Who Owns |
|---|---|---|---|
| Unit | Single function/class | ms | Developers |
| Component | UI component/module | ms-s | Developers |
| Contract | API boundaries | s | Dev + QA |
| Integration | Service interactions | s-min | QA |
| E2E | Full user flows | min | QA + DevOps |
Risk-Based Testing
- Identify risks for each feature (data loss, security, UX, performance)
- Score likelihood × impact
- Allocate test effort proportionally to risk score
- Reassess after each release
Coverage Goals
| Type | Target |
|---|---|
| Line coverage | >80% |
| Branch coverage | >75% |
| Mutation score | >60% |
| Critical path E2E | 100% |
| API endpoint tested | >90% |
Test Planning Template
## Feature: [Name]
- Unit tests: [count] — [files/scope]
- Integration tests: [count] — [services involved]
- E2E tests: [count] — [critical paths]
- Edge cases: [list]
- Performance threshold: [metric]
CI Integration
- Unit/component tests on every PR (fail under 5 min)
- Integration suite on every merge to main
- E2E nightly or on demand
- Flaky test detection → auto-quarantine → alert
Version History
- 38e2523 Current 2026-07-05 19:42


