当前位置: 首页 > Skill >

Testing Workflow

Testing Workflow

Testing Workflow

一种元技能,通过协调测试模式、端到端测试和测试代理,统筹项目全流程测试。适用于新项目搭建测试、现有项目提升覆盖率、制定测试策略或发布前质量验证。

0.1.0 2026.11.23 408
获取Skill文件查看使用说明
作 者:周安 许可证: 更新时间:2026.11.23
本文目录展开

Testing Workflow

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.

# 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

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,034
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,031
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,019
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,017
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,014
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,014
Skill 文件
  • SKILL.md
    • Testing Workflow
    • When to Use
    • Orchestration Flow
      • Phase 1: Discovery and Baseline
      • Phase 2: Strategy Selection
      • Phase 3: Implementation
      • Phase 4: Validation
      • Phase 5: Maintenance
    • Skill Routing Table
    • Coverage Targets
    • Testing Strategy Template
    • Quality Gates for Testing Completion
    • NEVER Do
  • 项目或源文件

相关 Skill

更多
Tester Workflow Tester Workflow Complete testing workflow from requirements analysis to test case generation and review - triggers on "完整测试流程", "testing workflow", "测试工作流", "端到端测试", "全流程测试"...
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...