Test strategy design — pyramid, automation, E2E, contract testing, shift-left, test data management. [EXPLICIT] Use when the user asks to "design test strategy", "build test automation", "implement contract testing", "manage test data", "define quality gates", or mentions test pyramid, Pact, Playwright, Cypress, coverage targets, flaky tests, chaos engineering. [EXPLICIT]
From jm-adknpx claudepluginhub javimontano/jm-adk-alfaThis skill is limited to using the following tools:
agents/guardian.mdagents/lead.mdagents/specialist.mdagents/support.mdevals/evals.jsonknowledge/body-of-knowledge.mdknowledge/knowledge-graph.mdprompts/meta.mdprompts/primary.mdprompts/variations/deep.mdprompts/variations/quick.mdreferences/testing-patterns.mdtemplates/output.docx.mdtemplates/output.htmlSearches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Testing strategy defines how quality is verified, automated, and measured across the software delivery lifecycle. The skill produces comprehensive test architectures covering shape selection, automation frameworks, contract testing, performance and chaos testing, test data management, and quality metrics that shift quality left while maintaining production confidence. [EXPLICIT]
Un test que no puede fallar no protege nada. La estrategia de testing no se mide por el porcentaje de coverage — se mide por la confianza que genera para hacer deploy un viernes a las 5pm.
The user provides a project or system name as $ARGUMENTS. Parse $1 as the project/system name used throughout all output artifacts. [EXPLICIT]
Parameters:
{MODO}: piloto-auto (default) | desatendido | supervisado | paso-a-paso
{FORMATO}: markdown (default) | html | dual{VARIANTE}: ejecutiva (~40% — S1 pyramid + S3 contracts + S6 metrics) | técnica (full 6 sections, default)Before generating strategy, detect the codebase context:
!find . -name "*.test.*" -o -name "*.spec.*" -o -name "*test*" -type d -o -name "jest*" -o -name "pytest*" -o -name "cypress*" | head -20
Use detected testing frameworks, languages, and existing test structure to tailor recommendations. [EXPLICIT]
If reference materials exist, load them:
Read ${CLAUDE_SKILL_DIR}/references/testing-patterns.md
Define the test architecture shape with ratio targets and ROI-based prioritization. [EXPLICIT]
Shape selection decision matrix:
| System Type | Recommended Shape | Ratio (Unit:Integration:E2E) | Rationale |
|---|---|---|---|
| Backend API, business logic-heavy | Pyramid (Fowler) | 70:20:10 | Pure functions, fast unit tests dominate |
| Frontend SPA, UI-heavy | Trophy (Kent C. Dodds) | 20:50:20 + static 10 | Integration tests provide best ROI for component interactions |
| Microservices, many boundaries | Honeycomb | 10:70:20 | Integration across service boundaries matters most |
| Monolith, legacy | Ice cream cone (invert it) | Start E2E, add unit as refactored | Characterization tests first, unit tests on new code |
Testing Trophy (Kent C. Dodds): Static analysis at base, then unit, then integration as the largest layer, then E2E at top. The trophy argues integration tests provide the best confidence-to-cost ratio — they combine realistic coverage with reasonable speed. "Write tests. Not too many. Mostly integration." As E2E tooling matures (Playwright, Vitest Browser Mode), the trophy's top layer grows increasingly cost-effective.
Produce:
Key decisions:
Design the automation infrastructure including tool selection, patterns, and execution strategy. [EXPLICIT]
Tool selection matrix:
| Language/Platform | Unit | Integration | E2E | Visual Regression |
|---|---|---|---|---|
| JavaScript/TypeScript | Vitest, Jest | Testing Library, Supertest | Playwright | Chromatic, Percy |
| Python | pytest | pytest + Testcontainers | Playwright | Percy |
| Java/Kotlin | JUnit 5, jqwik | Spring Boot Test, Testcontainers | Playwright, Selenium | Percy |
| .NET | xUnit, NUnit | WebApplicationFactory | Playwright | Percy |
| Mobile (iOS) | XCTest | XCUITest | Detox, Appium | Percy |
| Mobile (Android) | JUnit, Espresso | Espresso | Detox, Appium | Percy |
Produce:
Ensure service interfaces remain compatible through consumer-driven contracts and schema validation. [EXPLICIT]
Produce:
Contract testing decision matrix:
| Scenario | Approach | Tool |
|---|---|---|
| Internal microservices, multiple consumers | Consumer-driven | Pact |
| Public API, schema-first | Provider-driven | Specmatic, Prism |
| Event-driven, async messaging | Schema registry | Confluent Schema Registry, AWS Glue |
| GraphQL | Schema validation | Apollo Studio, GraphQL Inspector |
Integrate performance validation and failure injection into the testing lifecycle. [EXPLICIT]
Produce:
Chaos maturity model:
| Level | Practice | Environment |
|---|---|---|
| 1 - Learning | Manual fault injection, document results | Staging only |
| 2 - Automated | Scheduled chaos experiments in CI | Staging |
| 3 - Production | Canary chaos with automatic rollback | Production canary |
| 4 - Advanced | Continuous chaos, GameDays, cross-team | Production |
Tools: Chaos Monkey, Litmus, Gremlin, or custom fault injection. Require automatic rollback if safety thresholds exceeded. [EXPLICIT]
Design strategies for creating, managing, and cleaning test data across environments. [EXPLICIT]
Produce:
Database strategy per test level:
| Test Level | Strategy | Tools |
|---|---|---|
| Unit | In-memory, mocked | H2, SQLite, mocks |
| Integration | Containerized, real engine | Testcontainers |
| E2E | Seeded staging or ephemeral | Terraform, Docker Compose |
| Performance | Production-scale anonymized | Custom ETL, Faker at scale |
Incorporate modern testing approaches and define measurable quality indicators. [EXPLICIT]
Property-based testing: Define properties that must hold for all inputs instead of hand-writing examples (e.g., "encode then decode returns original"). Generate hundreds of random inputs; shrink failures to minimal reproducible cases. Particularly effective for parsers, serializers, algorithms, and state machines.
| Language | Tool | Integration |
|---|---|---|
| JS/TS | fast-check | Jest, Vitest |
| Python | Hypothesis | pytest |
| Java | jqwik | JUnit 5 |
| Scala | ScalaCheck | ScalaTest |
| Haskell | QuickCheck | HSpec |
Mutation testing: Seed small faults (mutants) into production code and verify tests catch them. Line coverage measures quantity; mutation testing measures quality.
| Language | Tool | Target Score | CI Cadence |
|---|---|---|---|
| Java | PIT/pitest | >80% on critical paths | Nightly |
| JS/TS/.NET | Stryker | >80% on critical paths | Nightly |
| Python | mutmut | >80% on critical paths | Nightly |
Run on CI nightly, not per-commit (too slow). Focus on critical business logic modules, not the entire codebase. [EXPLICIT]
Visual regression testing: Capture screenshots of UI components/pages, compare against baselines pixel-by-pixel or perceptually.
| Tool | Strength | Best For |
|---|---|---|
| Chromatic | Storybook-native, component-level | Design systems, component libraries |
| Percy | Cross-browser, full-page | Multi-browser apps, full pages |
| Playwright screenshots | Free, CI-integrated | Budget-conscious, custom pipelines |
| BackstopJS | Open source, self-hosted | Self-hosted requirement |
Test impact analysis: Map code changes to affected tests using coverage data. Run only tests that exercise changed code paths. Tools: Launchable, Gradle Enterprise predictive test selection. Reduces CI time 40-70% in large codebases while maintaining confidence.
Quality metrics — track these:
| Decision | Enables | Constrains | When to Use |
|---|---|---|---|
| Heavy unit testing | Fast feedback, cheap maintenance | Misses integration issues | Business logic-heavy, pure functions |
| E2E-heavy strategy | Catches user-facing bugs | Slow, flaky, expensive | Small apps, critical journeys only |
| Contract testing | Decoupled deployment, fast verification | Setup overhead, team coordination | Microservices, multi-team consumers |
| Chaos engineering | Reveals hidden failures | Risk of impact, needs monitoring | Production-ready with observability |
| Mutation testing | Validates test quality | Slow, high compute | Critical business logic modules |
| Property-based testing | Finds edge cases humans miss | Learning curve, slower tests | Parsers, serializers, algorithms |
Greenfield Project: Start with unit test framework from day one. Add integration tests as external dependencies emerge. Defer E2E until user journeys stabilize. Establish conventions early. [EXPLICIT]
Legacy System with No Tests: Start with characterization tests (capture current behavior). Add integration tests around critical paths. Introduce unit tests for new code only. Do not attempt 80% coverage retroactively. [EXPLICIT]
Microservices with Many Consumers: Contract testing is essential. Set up Pact Broker or schema registry. Establish can-i-deploy gates. Each team owns their consumer tests. [EXPLICIT]
Monorepo with Multiple Teams: Use test impact analysis: detect changed modules, run only related tests. Shared test utilities in a common package. Team-owned suites with cross-team integration tests. [EXPLICIT]
Regulated Environment: Test evidence is a compliance artifact. Document test plans, link tests to requirements, archive results. Maintain a traceability matrix: requirement --> test case --> execution result. [EXPLICIT]
Before finalizing delivery, verify:
| Format | Default | Description |
|---|---|---|
markdown | Yes | Rich Markdown + Mermaid diagrams. Token-efficient. |
html | On demand | Branded HTML (Design System). Visual impact. |
dual | On demand | Both formats. |
Default output is Markdown with embedded Mermaid diagrams. HTML generation requires explicit {FORMATO}=html parameter. [EXPLICIT]
Primary: A-01_Testing_Strategy.html — Executive summary, test shape design, automation framework, contract testing setup, chaos engineering plan, test data strategy, quality metrics dashboard.
Secondary: Test framework configuration files, Pact contract examples, quality gate definitions, flaky test management runbook.
Author: Javier Montaño | Last updated: 2026-03-18