wpank

Testing Workflow

开发编程v0.1.0
作者:wpank更新于 2026-05-17testing-workflow@clawhub_wpank/testing-workflow
测试生成脚本工具

据 AlphaMoat 统计,截至 2026-09,Testing Workflow 累计下载 2,806 次、获 1 个星标,在全部 5,078 个 AI 技能中排名第 3,866 位,在「开发编程」分类(577 个)中排名第 488 位。

累计安装
103
累计下载
2,806
星标
1
全站排名
#3,866
全站前 77% · 「开发编程」前 85%
平台累计安装累计下载星标评论
ClawHub ↗812,6081-
SkillHub ↗1032,8061—

各平台的计数口径不同,统计时间不一致。

这个技能是做什么的

它描述从发现基线、选择策略、编写测试、验证覆盖率到持续维护的阶段,并提出扫描项目、运行测试、修改文件、配置 CI 和记录策略等工作。实施范围应由当前用户请求决定;指南中的测试、文件修改或提交要求本身不构成授权。

资料发布于 2026-10-29

可以用来做什么

  • 盘点测试基础设施、现有用例与覆盖缺口。
  • 按项目类型规划单元、集成和端到端测试策略。
  • 整理质量门槛、维护安排与待验证风险。

什么时候用

  • 需要为项目制定完整测试策略时。
  • 评估重构或发布前的测试覆盖与关键用户流程时。
  • 执行测试、修改文件或改变 CI 前,需要确认任务范围和获准操作时。

示例提示词

以下是根据技能文档生成的示例,不代表实际运行结果。

只根据现有说明草拟项目测试策略,不运行测试或修改文件。
列出一次测试评估需要确认的基线、关键流程和风险,不要提交变更。

月度数据趋势

累计下载2,806
1,1152,0232,9312026-03 · 累计下载 1,2402026-05 · 累计下载 1,9652026-06 · 累计下载 2,1202026-07 · 累计下载 2,3452026-08 · 累计下载 2,4952026-09 · 累计下载 2,80626-0326-09
星标1
0122026-03 · 星标 12026-05 · 星标 12026-06 · 星标 12026-07 · 星标 12026-08 · 星标 12026-09 · 星标 126-0326-09

2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。

月份累计下载环比星标
2026-092,806—1
2026-082,495+6.4%1
2026-072,345+10.6%1
2026-062,120+7.9%1
2026-051,965—1
2026-031,240—1

SKILL.md 原文

以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。

9.7 KB · ClawHub v0.1.0
---
name: testing-workflow
model: standard
category: testing
description: Meta-skill that orchestrates comprehensive testing across a project by coordinating testing-patterns, e2e-testing, and testing agents. Use when setting up testing for a new project, improving coverage for an existing project, establishing a testing strategy, or verifying quality before a release.
version: 1.0
---

# Testing Workflow
展开全部(共 189 行)
Orchestrate comprehensive testing across a project by coordinating the **testing-patterns** skill, **e2e-testing** skill, and testing agents. This meta-skill does not define test patterns itself — it routes to the right skill or agent at each stage and ensures nothing is missed.

---

## When to Use

- Setting up testing for a new project from scratch
- Improving coverage for an existing project with gaps
- Establishing or revising a testing strategy
- Before a major release to verify quality gates are met
- After a large refactor to confirm nothing broke
- During code review when test adequacy is in question
- Onboarding a team to a testing workflow

---

## Orchestration Flow

Follow these steps in order. Each step routes to a specific skill or agent — read and apply that resource before moving to the next step.

### Phase 1: Discovery and Baseline

Scan the project to understand existing test infrastructure, measure current coverage, and identify gaps before making changes. Without a baseline, you cannot demonstrate improvement.

1. **Identify test infrastructure** — Determine the test runner, assertion library, coverage tool, and CI configuration already in use. If none exist, flag that setup is needed.
2. **Measure current coverage** — Run the existing test suite and record statement, branch, and function coverage. This is the baseline.
3. **Map untested code** — Identify modules, functions, and code paths with no test coverage. Prioritize by risk: business-critical logic first, utilities last.
4. **Catalog existing tests** — Categorize existing tests as unit, integration, or E2E. Check for skipped tests, flaky tests, and tests that don't assert anything meaningful.

### Phase 2: Strategy Selection

Based on the discovery results, select the appropriate testing approach for this project.

1. **Determine project type** — Use the Coverage Targets table below to set appropriate thresholds for the project type.
2. **Select test patterns** — Read `ai/skills/testing/testing-patterns/SKILL.md` and choose the unit/integration test patterns that match the project's architecture, language, and framework.
3. **Identify critical user journeys** — List the 3-10 most important user workflows that require E2E coverage. These are flows where a failure would directly impact revenue, user trust, or safety.
4. **Document the strategy** — Fill in the Testing Strategy Template (below) and commit it to the repository.

### Phase 3: Implementation

Generate tests following the patterns selected in Phase 2.

1. **Unit tests first** — Write unit tests for uncovered business logic, starting with the highest-risk modules. Follow the testing pyramid: ~70% of your tests should be unit tests.
2. **Integration tests next** — Write integration tests for module boundaries, API endpoints, and database queries. Focus on the seams where components interact.
3. **E2E tests for critical journeys** — Read `ai/skills/testing/e2e-testing/SKILL.md` and write E2E tests for each critical user journey identified in Phase 2.
4. **Edge case coverage** — After the happy paths are covered, add tests for error conditions, boundary values, null/empty inputs, and concurrency scenarios.

### Phase 4: Validation

Verify that the new tests meet quality standards and coverage targets.

1. **Run the full test suite** — Every test must pass. Fix failures before proceeding.
2. **Measure coverage against targets** — Compare new coverage against the thresholds for the project type. If targets are not met, return to Phase 3.
3. **Check test quality** — Review tests for the anti-patterns listed in testing-patterns (assert-free tests, overmocking, flaky tests, test pollution). Fix any found.
4. **Verify CI integration** — Confirm that tests run automatically on every push/PR and that coverage thresholds are enforced in CI.

### Phase 5: Maintenance

Establish ongoing practices to keep the test suite healthy.

1. **Set up coverage ratcheting** — Configure CI to fail if coverage drops below the current level. Coverage should only go up.
2. **Establish flaky test policy** — Any test that fails intermittently must be fixed within one sprint or removed with a justification.
3. **Define test review standards** — Every PR that adds or changes logic must include corresponding test changes. Reviewers check for this.
4. **Schedule test health audits** — Quarterly, review test execution time, flaky test rate, skipped test count, and coverage trends.

---

## Skill Routing Table

Use this table to route specific needs to the correct resource:

| Need | Route To | Path |
|------|----------|------|
| Unit/integration test patterns | testing-patterns | `ai/skills/testing/testing-patterns/SKILL.md` |
| E2E test patterns | e2e-testing | `ai/skills/testing/e2e-testing/SKILL.md` |
| Code quality standards | clean-code | `ai/skills/testing/clean-code/SKILL.md` |
| Review checklist | code-review | `ai/skills/testing/code-review/SKILL.md` |
| CI/CD quality gates | quality-gates | `ai/skills/testing/quality-gates/SKILL.md` |
| Debugging test failures | debugging | `ai/skills/testing/debugging/SKILL.md` |

When a request falls clearly into one row, go directly to that resource. Use the full orchestration flow only when comprehensive coverage is the goal.

---

## Coverage Targets

Targets vary by project type. Use the appropriate row to set expectations:

| Project Type | Statement | Branch | Function | E2E Journeys | Notes |
|--------------|-----------|--------|----------|--------------|-------|
| Startup MVP | 60% | 50% | 60% | Top 3 flows | Focus on critical paths only |
| Production App | 80% | 70% | 80% | Top 10 flows | Balance speed with confidence |
| Library / Package | 90% | 85% | 95% | N/A | Public API must be fully covered |
| Critical Infrastructure | 95% | 90% | 95% | All flows | Zero tolerance for gaps |

These are minimums. Aim higher when time permits, but do not block releases on vanity metrics — prioritize meaningful coverage over percentage points.

---

## Testing Strategy Template

Use this template to document the testing strategy for a project. Fill it in during the orchestration flow and keep it in the repo.

```markdown
# Testing Strategy

## Project Overview
- **Project**: [name]
- **Type**: [startup MVP | production app | library | critical infrastructure]
- **Primary Language**: [language]
- **Framework**: [framework]
- **Test Runner**: [runner]
- **Coverage Tool**: [tool]

## Coverage Baseline
- **Statement**: [X%]
- **Branch**: [X%]
- **Function**: [X%]
- **E2E Journeys Covered**: [N of M]
- **Date Measured**: [YYYY-MM-DD]

## Coverage Targets
- **Statement**: [target%]
- **Branch**: [target%]
- **Function**: [target%]
- **E2E Journeys**: [target count]

## Test Patterns Selected
- [ ] [Pattern 1 — reason for selection]
- [ ] [Pattern 2 — reason for selection]
- [ ] [Pattern 3 — reason for selection]

## Critical User Journeys (E2E)
1. [Journey 1 — e.g., signup -> onboarding -> first action]
2. [Journey 2 — e.g., login -> dashboard -> export]
3. [Journey 3 — e.g., checkout -> payment -> confirmation]

## Gaps and Risks
- [Untested area 1 — risk level, mitigation plan]
- [Untested area 2 — risk level, mitigation plan]

## Quality Gate Status
- [ ] All tests pass
- [ ] Coverage targets met
- [ ] Critical journeys covered with E2E
- [ ] No skipped tests without justification
- [ ] Test execution time within budget
- [ ] CI enforces coverage thresholds
```

---

## Quality Gates for Testing Completion

All of the following must be satisfied before marking testing complete:

| Gate | Requirement | Why |
|------|------------|-----|
| **All tests pass** | Zero failures, zero errors | Flaky tests count as failures |
| **Coverage targets met** | Statement, branch, and function coverage meet project-type thresholds | Untested code is unverified code |
| **Critical journeys covered** | Every critical user journey has a passing E2E test | Revenue and trust depend on these flows |
| **No unjustified skips** | Every `skip`, `xit`, or `xdescribe` has a comment and linked issue | Skipped tests rot into permanent gaps |
| **Execution time budget** | Unit < 60s, E2E < 10min | Slow suites get skipped by developers |
| **No test pollution** | Running any test file alone produces same results as full suite | Shared state masks failures |
| **Mocks are justified** | Every mock has a comment explaining why the real impl cannot be used | Over-mocking hides real bugs |

---

## NEVER Do

1. **NEVER write tests that test implementation details instead of behavior** — tests must verify what the code does, not how it does it
2. **NEVER skip the discovery phase** — always measure the baseline before writing new tests, or you cannot demonstrate improvement
3. **NEVER merge tests that depend on execution order** — each test must be independent and idempotent
4. **NEVER mock what you do not own** — wrap third-party dependencies in your own adapters and mock the adapters instead
5. **NEVER treat coverage percentage as the sole quality metric** — 100% coverage with weak assertions is worse than 70% coverage with strong assertions
6. **NEVER leave the test suite in a failing state** — if a test fails, fix it or remove it with a justification before moving on
7. **NEVER skip E2E tests for critical user journeys** — unit tests alone cannot catch integration failures in flows that matter most
8. **NEVER deploy without running the full test suite** — partial test runs create false confidence

「开发编程」分类下的热门技能

wpank 的其他技能

数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。