AGENT SKILL

testing-strategy-standards

Use for cross-cutting testing decisions in a touchstone repo — test pyramid/layering, what to mock, contract testing between services, test data, flaky-test handling, or coverage policy. Invoke when designing a test suite or dealing with a flaky/slow test (per-language test mechanics live in the language skills).

License 许可
MIT
所属仓库
hwanngo/touchstone
最近更新
2026-08-26
Stars
★ 0
Forks
0

01 前言 Front Matter

name
testing-strategy-standards
license
MIT
metadata
{ "author": "touchstone", "version": "0.2.0" }
description
Use for cross-cutting testing decisions in a touchstone repo — test pyramid/layering, what to mock, contract testing between services, test data, flaky-test handling, or coverage policy. Invoke when designing a test suite or dealing with a flaky/slow test (per-language test mechanics live in the language skills).

03 SKILL.md 正文

Testing Strategy

Full standard: standards/practices/testing-strategy.md in the touchstone repo. Load-bearing rules:

Always

  • Pyramid: many fast unit + a solid integration layer + few e2e. Test behaviour, not implementation.
  • Mock at the boundary (network/process), not internals — MSW for frontend HTTP; fakes over mocks. Don't over-mock.
  • Contract tests (Pact / buf breaking) on service seams so independent deploys don't break consumers.
  • Hermetic + deterministic: no shared mutable state, no real network/clock; data-dependent tests self-skip when fixtures absent.

Flaky-test policy (the senior bit)

  • Quarantine flaky tests fast; auto-ticket with an owner; a flake budget.
  • Banned: "fix" a flake by retry-to-green. Flakiness is a bug.

Coverage

  • Floor 80% line / 60% branch, ratcheted; new code shouldn't lower it. No coverage-number worship. Mutation testing (scale-up).

Done

Pyramid shape (unit-heavy, few e2e) · mocks only at boundaries · contract tests on service seams · suite hermetic + deterministic, no retry-to-green · coverage ≥ floor, ratcheted. See standards/practices/testing-strategy.md.

04 同仓库更多 Skills