testing-quality
Testing pyramid, deterministic tests, regression tests, behavior assertions, test isolation, flaky detection, representative fixtures
- License 许可
- MIT
- 最近更新
- 2026-11-02
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- testing-quality
- description
- Testing pyramid, deterministic tests, regression tests, behavior assertions, test isolation, flaky detection, representative fixtures
02 资源文件 6
- 参考文档checks/test-quality-checklist.md352 B
- 参考文档examples/mocking_best_practices.md1.5 KB
- 参考文档manifest.json1.2 KB
- 参考文档references/testing-pyramid.md1.5 KB
- 脚本scripts/check_test_coverage.sh1.1 KB
- 参考文档templates/testing-quality-template.md828 B
03 SKILL.md 正文
Testing Quality Engineering
1. Testing Pyramid
Structure the test suite according to the Testing Pyramid: a broad base of fast, isolated unit tests, a smaller middle layer of integration tests, and a narrow peak of slow, end-to-end (E2E) tests. Push tests down the pyramid wherever possible.
2. Deterministic Execution
Tests must be perfectly deterministic. A test that passes sometimes and fails others is worse than no test. Eliminate sources of non-determinism: network calls, uncontrolled timers, random number generators, and shared mutable state.
3. Regression Test Coverage
Ensure every discovered bug is accompanied by a regression test before fixing. The test must fail before the fix and pass after. This builds an unbreakable safety net and prevents the same bug from reappearing.
4. Behavior Assertions
Assert against observable behavior, not internal implementation details. Test the public API of a component. Avoid mocking internal methods or checking private state, as this leads to fragile tests that break during refactoring.
5. Strict Test Isolation
Each test must run in complete isolation. Tests must not depend on the execution order or the side effects of other tests. Reset the database, clear caches, and recreate objects before each test run.
6. Flaky Test Detection
Implement automated mechanisms to detect and quarantine flaky tests. Re-run failed tests locally or in CI to identify non-determinism. Treat a flaky test as a failing test and prioritize its repair or removal.
7. Representative Fixtures
Use realistic, representative data for test fixtures. Avoid overly simplistic 'foo/bar' data if domain-specific constraints exist. Use factories or builders to generate valid, complex objects easily without cluttering the test setup.
8. Mutation Testing
Use mutation testing tools to evaluate the quality of your test suite. These tools introduce small defects (mutations) into your code and check if your tests catch them. High coverage doesn't guarantee good assertions; mutation testing does.
9. Test Driven Development (TDD)
Encourage TDD as a design tool. Writing tests first forces you to think about the API from the consumer's perspective, leading to simpler, more decoupled, and more testable code architectures.
10. Performance Testing
Integrate performance tests into the CI pipeline to catch regressions. Assert on response times, memory usage, and CPU load under simulated load. Establish baselines and fail the build if performance degrades beyond acceptable thresholds.
04 同仓库更多 Skills
lang-aipo
Aipo V1 canonical engineering, ADR-001 syntax conformance, braces blocks, Tipo:nome method bindings, structural interfaces, transactional failure handling, and anti-hallucination guardrails for LLMs.
goal-management
暂无简介
evidence-collection
暂无简介
code-review
暂无简介
testing-quality
Testing pyramid, deterministic tests, regression tests, behavior assertions, test isolation, flaky detection, representative fixtures
cognitive-clarity
Unambiguous communication, single-decision focus, visual structuring, and rationale-first explanation tailored for neurodivergent collaboration