Skip to content
Skills Library
Programming · Testing

testing

/testing

Testing strategies and methodologies including TDD and E2E testing. Use when writing tests, implementing TDD workflow, or setting up E2E test infrastructure.

Repository
cc-best ↗
Licence
MIT
Last repository change
12.06.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
6
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 12.06.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Testing strategies and methodologies including TDD and E2E testing. Use when writing tests, implementing TDD workflow, or setting up E2E test infrastructure.

Original author description

Testing strategies and methodologies including TDD and E2E testing. Use when writing tests, implementing TDD workflow, or setting up E2E test infrastructure.

How it works

  1. 子文件
  2. 测试金字塔
  3. 测试策略选择
  4. 覆盖率目标
  5. 最佳实践
  6. TDD 循环速览
  7. E2E 测试速览
  8. 测试命令
Original SKILL.md headings · 97 lines, 275 words
SKILL.md preview
---
name: testing
description: "Testing strategies and methodologies including TDD and E2E testing. Use when writing tests, implementing TDD workflow, or setting up E2E test infrastructure."
allowed-tools: Read, Write, Edit, Bash, Grep, Glob
---

# 测试策略

> 关联 Agent: `tdd-guide`(测试驱动开发)、`code-reviewer`(可测试性评估)、`build-error-resolver`(修复后测试验证)

本技能提供测试策略选择指南,整合 TDD(测试驱动开发)和 E2E(端到端测试)最佳实践。

## 子文件

- [tdd.md](tdd.md) - 测试驱动开发工作流
- [e2e.md](e2e.md) - Playwright E2E 测试指南
- [tdd-example.md](tdd-example.md) - 完整 TDD 会话示例
- [frameworks.md](frameworks.md) - 测试框架配置与 Mock 模式
- [qa-methodology.md](qa-methodology.md) - QA 角色方法论与验证流程

## 测试金字塔

```
        ┌─────────┐
        │  E2E   │  少量:验证核心流程
        ├─────────┤
        │集成测试 │  中等:验证组件交互
        ├─────────┤
        │单元测试 │  大量:验证独立单元
        └─────────┘
```

## 测试策略选择

| 场景             | 推荐策略             | 参阅文件 |
| ---------------- | -------------------- | -------- |
| 新功能开发       | TDD(测试先行)      | `tdd.md` |
| Bug 修复         | 先写失败测试,再修复 | `tdd.md` |
| 核心用户流程验证 | E2E 测试             | `e2e.md` |
| 重构现有代码     | 先补测试,再重构     | `tdd.md` |
| UI 交互验证      | E2E + 视觉回归       | `e2e.md` |

## 覆盖率目标

| 代码类型     | 单元测试 | E2E 测试 |
| ------------ | -------- | -------- |
| 核心业务逻辑 | 100%     | 关键流程 |
| 普通业务代码 | 80%+     | 可选     |
| 工具函数     | 80%+     | 不需要   |
| UI 组件      | 70%+     | 关键交互 |

## 最佳实践

1. **测试先行** - TDD 循环:RED → GREEN → REFACTOR
2. **独立隔离** - 每个测试独立运行,无共享状态
3. **快速反馈** - 单元测试 < 50ms,E2E 适度控制
4. **语义命名** - 测试名称描述行为,不描述实现
5. **分层覆盖** - 单元测试多,E2E 测试精

## TDD 循环速览

```
RED → GREEN → REFACTOR → REPEAT

RED:      写一个失败的测试
GREEN:    写最少的代码使测试通过
REFACTOR: 改进代码,保持测试绿色
REPEAT:   下一个场景
```

详细指南参阅 `tdd.md`

## E2E 测试速览

```
tests/
├── e2e/                       # E2E 测试目录
│   ├── auth/                  # 认证流程
│   └── core/                  # 核心功能
├── pages/                     # Page Object Model
└── playwright.config.ts
```

详细指南参阅 `e2e.md`

## 测试命令

```bash
# 单元测试
npm test
npm test -- --coverage

# E2E 测试
npx playwright test
npx playwright test --headed  # 可视化
npx playwright test --debug   # 调试模式
```

---

> **记住**:测试不是可选项。它是支持自信重构、快速开发和生产可靠性的安全网。
Files in this package (6)
  • SKILL.md 3 KB
  • e2e.md 6 KB
  • frameworks.md 5 KB
  • qa-methodology.md 10 KB
  • tdd-example.md 9 KB
  • tdd.md 8 KB

Versions

RepositoryScoreLicence
This page · xiaobei930/cc-best100MIT
iuliandita/skills100MIT
wrongstack/wrongstack100MIT
langwatch/langwatch100Apache-2.0
mcouthon/agents100MIT
nteract/nteract100BSD-3-Clause
kettleofketchup/DraftForge100GPL-3.0
skillberry-ai/cap-evolve100Apache-2.0
TheBeardedBearSAS/claude-craft100MIT

Database snapshot: 13.11.2026 · package version a47b2b33ee96 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 91python-testing-patterns
    Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.
  • 100testing-patterns
    Jest testing patterns, factory functions, mocking strategies, and TDD workflow. Use when writing unit tests, creating test factories, or following TDD red-green-refactor cycle.
  • 100testing-patterns
    Jest testing patterns, factory functions, mocking strategies, and TDD workflow. Use when writing unit tests, creating test factories, or following TDD red-green-refactor cycle.
  • 91javascript-testing-patterns
    Implement comprehensive testing strategies using Jest, Vitest, and Testing Library for unit tests, integration tests, and end-to-end testing with mocking, fixtures, and test-driven development. Use when writing JavaScript/TypeScript tests, setting up test infrastructure, or…
  • 95testing-principles
    This skill provides language-agnostic testing principles including TDD, test quality, coverage standards, and test design patterns. Automatically loaded when writing tests, designing test strategies, reviewing test quality, or when the user mentions "TDD", "test coverage", "unit…
  • 100testing-ops
    Cross-language testing strategies and patterns. Triggers on: test pyramid, unit test, integration test, e2e test, TDD, BDD, test coverage, mocking strategy, test doubles, test isolation.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.