技能 编程开发 结构化测试指南

结构化测试指南

v20260307
testing
提供贯穿 TDD 流程、测试组织、框架适配、Mock 策略与覆盖要求的全面实践,帮助开发团队在构建可靠测试套件时保持一致性与质量。
获取技能
283 次下载
概览

Testing Skill

Comprehensive testing guidance covering:

  • TDD Workflow: Red → Green → Refactor cycle with practical examples
  • Test Organization: Unit / Integration / E2E test structure
  • Framework Support: pytest, Jest, JUnit5, xUnit, Google Test
  • Mock Strategies: Only mock external boundaries, not internal logic
  • Coverage Requirements: 80%+ with meaningful assertions

When Loaded

This skill is automatically injected when working with:

  • /cc-best:dev — Implementation with tests
  • tdd-guide agent — Test-driven development guidance
  • build-error-resolver agent — Fixing test failures

Key Rules

  1. Tests first — Write failing test before implementation
  2. AAA pattern — Arrange, Act, Assert in every test
  3. No shared mutable state — Each test is independent
  4. Descriptive namestest_<feature>_<scenario>_<expected>
信息
Category 编程开发
Name testing
版本 v20260307
大小 1KB
更新时间 2026-03-08
语言