testing-strategies

Zate 的头像作者 Zate

设计全面的测试策略,包括单元测试、集成测试、端到端测试和部署验证测试。在规划测试覆盖率、生成测试或确保部署就绪时使用。

📖 中文导读:设计全面的测试策略,包括单元测试、集成测试、端到端测试和部署验证测试。在规划测试覆盖率、生成测试或确保部署就绪时使用。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。

name: testing-strategies description: This skill should be used for test coverage, test pyramid, unit/integration/E2E test design, TDD, BDD, mocking strategies, test doubles, test architecture whenToUse: Designing tests, coverage strategy, test pyramid, TDD, BDD, mocking, test doubles, test organization, E2E testing, integration testing strategy whenNotToUse: Simple test additions, established patterns, single test file edits seeAlso:

  • skill: architecture-patterns when: test architecture decisions
  • skill: react-patterns when: React component testing
  • skill: python-patterns when: pytest patterns
  • skill: go-patterns when: Go table-driven tests
  • skill: superpowers:test-driven-development when: writing tests first, rigorous TDD discipline

Testing Strategies

Comprehensive test design for deployment readiness.

Test Pyramid

    /  E2E  \       Few, slow, expensive
   /  Integ  \      Some, medium
  /   Unit    \     Many, fast, cheap

Coverage Guidelines

Level Coverage Focus
Unit 80%+ Business logic
Integration Key paths APIs, DB
E2E Critical flows User journeys

Unit Test Patterns

  • Test one thing per test
  • Clear arrange/act/assert
  • Mock external dependencies
  • Fast execution (<1s each)

Integration Test Patterns

  • Test real dependencies
  • Use test databases
  • Clean up after tests
  • Cover API contracts

E2E Test Patterns

  • Critical user journeys only
  • Stable selectors
  • Retry flaky network calls
  • Parallel where possible