Skip to content
Skills Library
Programming · Planning

testing-strategy

/testing-strategy

Formulates a comprehensive testing strategy (Pyramid vs Trophy) and selects appropriate tools. Use when: test plan, testing strategy, qa strategy, e2e testing, integration testing, contract testing.

Repository
gabbe ↗
Licence
CC-BY-4.0
Last repository change
24.10.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
2
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

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

Licence

CC-BY-4.0, otwarta.

What it does and when to use it

Formulates a comprehensive testing strategy (Pyramid vs Trophy) and selects appropriate tools. Use when: test plan, testing strategy, qa strategy, e2e testing, integration testing, contract testing.

Original author description

Formulates a comprehensive testing strategy (Pyramid vs Trophy) and selects appropriate tools. Use when: test plan, testing strategy, qa strategy, e2e testing, integration testing, contract testing.

How it works

  1. Goal
  2. Strategies
  3. Advanced Tiers (Beyond the Pyramid)
  4. Steps
  5. deliverables
  6. Security & Guardrails
Original SKILL.md headings · 68 lines, 990 words
SKILL.md preview
---
name: testing-strategy
description: "Formulates a comprehensive testing strategy (Pyramid vs Trophy) and selects appropriate tools. Use when: test plan, testing strategy, qa strategy, e2e testing, integration testing, contract testing."
license: CC-BY-SA-4.0
metadata:
  source: "agents/skills/coding/testing-strategy.skill.md"
  tags: "coding"
  core: "false"
  context_cost: "medium"
---
# Testing Strategy Skill

## Goal
To help the user or agent define *what* to test, *how* to test it, and *where* to focus effort based on the project architecture.

## Strategies

### 1. The Testing Pyramid (Classic)
**Best for**: Monoliths, Backend-heavy apps.
-   **Structure**: 70% Unit, 20% Integration, 10% E2E.
-   **Focus**: Fast feedback loop at the unit level.
-   **Tools**: Jest/Vitest (Unit), Supertest (Int), Playwright (E2E).

### 2. The Testing Trophy (Modern / Frontend-heavy)
**Best for**: React/Next.js apps, UI-heavy frontends. (For microservices, prefer Contract Testing — see below.)
-   **Structure**: Static Analysis (Base) -> Unit -> **Integration (Big)** -> E2E (Top).
-   **Focus**: "Write tests. Not too many. Mostly integration." (Kent C. Dodds).
-   **Rationale**: Integration tests give the most confidence per dollar.

### 3. Contract Testing (Microservices)
**Best for**: Distributed systems where teams work independently.
-   **Focus**: Verifying API contracts between Consumer and Provider.
-   **Tools**: Pact.

## Advanced Tiers (Beyond the Pyramid)

Example-based unit/integration tests only exercise the cases a human thought to write.
The following four tiers attack the gaps — covering input spaces, relations, failure
modes, and the quality of the tests themselves.

-   **Property-Based Testing** (`pbt-strategy.skill`): Instead of asserting on hand-picked examples, declare *properties* (invariants) that must hold for all inputs, then let a generator (Hypothesis, fast-check) throw thousands of randomized cases at the function and **shrink** any counterexample to its minimal form. Best for parsers, serializers, encoders/decoders (round-trip properties), and pure business logic where you can state "for all X, this must be true."
-   **Metamorphic Testing** (`metamorphic-testing.skill`): For systems with no easy oracle (ML models, search ranking, numerical/optimization code, LLM pipelines), you cannot assert the exact output — but you *can* assert **relations between related inputs**. E.g. "translating A→B→A preserves meaning," "adding an irrelevant doc must not change the top result," "scaling all prices by 2x doubles the total." Metamorphic relations turn an unknowable correct answer into a checkable consistency rule.
-   **Chaos / Fault-Injection** (`chaos-fault-injection.skill`): Verify resilience by *deliberately injecting failures* — kill processes, drop network packets, inject latency, exhaust disk/memory, return 500s from dependencies — and assert the system degrades gracefully (circuit breakers trip, retries back off, no data loss). Tests the failure paths that happy-path suites never touch; tools include Toxiproxy, Chaos Mesh, and `pytest`-level dependency stubs that raise on demand.
-   **Mutation Testing**: Measures *test-suite quality* rather than code behavior. A mutation tool (e.g. **mutmut** for Python, Stryker for JS) introduces small faults ("mutants") into the source — flip a `<` to `<=`, swap `+` for `-`, drop a statement — and re-runs the tests. A mutant that survives means no test detected the change, exposing a coverage blind spot. The **mutation score** (killed mutants ÷ total mutants) is a far stronger signal of test effectiveness than line coverage, which the "100% Coverage" Fallacy below warns against.

Tests verify determinism; **evals** score probabilistic quality — see `eval-driven-development.skill`.

## Steps
1.  **Analyze Project**:
    -   Is it a monolith or microservices?
    -   Is it UI-heavy or API-heavy?
2.  **Select Strategy**:
    -   *UI-Heavy* -> Recommend **Testing Trophy** (Focus on component integration tests).
    -   *Complex Business Logic* -> Recommend **Pyramid** (Heavy unit testing).
    -   *Microservices* -> Add **Contract Testing**.
3.  **Define Tool Stack**:
    -   **Unit/Int**: Vitest (JS/TS), Pytest (Python), PHPUnit (PHP).
    -   **E2E**: Playwright (Recommended) or Cypress.
    -   **Visual**: Percy, Chromatic.

## deliverables
-   Generate a `TEST_PLAN.md` using `templates/coding/TEST_PLAN_TEMPLATE.md`.
-   Configure CI/CD pipelines to run tests in the correct order (Fastest -> Slowest).

## Security & Guardrails

### 1. Skill Security (Testing Strategy)
- **Malicious Test De-prioritization**: An attacker might subtly attempt to convince the LLM or developer to abandon the "Testing Trophy" or Contract Testing in favor of an unbalanced, unit-test-only strategy. This intentionally creates systemic blind spots at the integration boundaries, where complex authentication and data-flow vulnerabilities typically reside. The agent must firmly reject any generated `TEST_PLAN.md` that completely omits Integration or E2E coverage for mission-critical paths.
- **Test Environment Data Exfiltration**: When defining the Tool Stack (Step 3), the agent might recommend tools or SaaS platforms (like cloud-based browser testing or visual regression services) without considering data sovereignty. If the E2E tests process actual production data replicas, routing that data through third-party CI environments constitutes a massive data breach. The strategy MUST mandate data sanitization protocols prior to any data entering the testing ecosystem.

### 2. System Integration Security
- **Symmetrical Vulnerability Injection**: If the agent uses the same LLM context to write both the implementation code and the security tests for that code, the LLM will likely suffer from systemic blind spots, writing tests that perfectly mirror the flaws in its implementation. To break this symmetry, the Testing Strategy must advocate for *adversarial test generation*, where a separate agent persona (e.g., `ops-security`), using a different prompt or model, is responsible for writing the vulnerability tests.
- **CI/CD Pipeline DoS**: The agent instructs configuring CI/CD pipelines (Deliverables). If the agent recommends a strategy that triggers thousands of Heavy E2E browser tests on every single micro-commit, it will effectively execute a Denial of Service against the organization's CI infrastructure and drastically increase compute costs. The strategy must enforce strict "Test Tiering" (e.g., running slow E2E tests only on PR merge or nightly, while keeping pre-commit hooks fast).

### 3. LLM & Agent Guardrails
- **Hallucinated Testing Frameworks**: The LLM might recommend a trendy but immature or unmaintained testing framework it saw briefly in its training data (e.g., an obscure Selenium wrapper). The agent must strictly bind its tool recommendations (Step 3) to the "Approved Tool Stack" defined in the project's architectural CONSTITUTION, rejecting hallucinated or out-of-policy libraries.
- **The "100% Coverage" Fallacy**: The LLM might fixate on achieving an artificial metric like "100% Code Coverage" as the primary goal of the strategy. This leads to useless assertion-free tests that just execute code lines to satisfy the coverage crawler, providing a dangerous false sense of security. The strategy prompt must explicitly prioritize "Confidence in Critical Paths" over arbitrary percentage metrics.
Files in this package (2)
  • SKILL.md 7 KB
  • templates/coding/TEST_PLAN_TEMPLATE.md 1 KB

Versions

RepositoryScoreLicence
This page · andreibesleaga/gabbe100CC-BY-4.0
komluk/scaffolding100MIT
oborchers/fractional-cto100MIT
anastasiyaw/codex-claude-code-config100MIT
organizzolini/codebase100MIT
shinpr/agentic-code100MIT
sagargupta16/claude-code-recipes100MIT
officialdb/TES-SKILLS100Apache-2.0
zakariaf/flutter-skills100MIT

Database snapshot: 13.11.2026 · package version 24d0acd3824e (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

  • 100test-strategy
    When the user wants to design, audit, or evolve a test strategy — the shape of their test pyramid, the balance of unit / integration / E2E / contract / perf / accessibility tests, what shifts left vs right, what each layer is and isn't responsible for, and how to gate releases.…
  • 95qa-strategy
    Testing strategy and QA patterns. Use for test pyramid design, E2E test architecture, test automation frameworks, performance testing, and bug triage processes.
  • 80role-aqa:test-strategy
    Designs comprehensive test strategies: test pyramid/trophy/diamond/honeycomb models, risk-based prioritization, shift-left, mutation testing, testing in production (feature flags, canary, shadow traffic), AI-assisted test generation, quality metrics (DORA, defect escape rate),…
  • 95testing-fundamentals
    Guides test strategy for unit, integration, and E2E testing. Use when junior asks "how do I test", "write tests", "what should I test", "test coverage", "mocking", or works with Vitest, Jest, Playwright. Provides testing pyramid and AAA patterns.
  • 90quality-integration-testing
    Use when the user asks about integration testing, component testing, API testing, database testing, test containers, wiremock, contract testing, or service-level testing. Do NOT use for: unit testing (quality-unit-testing), E2E testing (quality-e2e-testing), or contract testing…
  • 100sota-testing
    State-of-the-art software testing strategy and practice (2026) for designing test strategy, writing unit/integration/e2e tests, or auditing test suites. Covers suite shape (pyramid/trophy/honeycomb), test design quality (behavior-first, AAA, determinism, smells), test doubles…

Feedback and reports

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