Test Strategy Designer
Produces a tailored testing strategy that defines what to test, how to test it, and at what layer — balancing coverage, speed, and confidence for a given system architecture.
Guiding Principle
"Tests are not a tax on development; they are the specification made executable."
Procedure
Step 1 — Analyze the System Under Test
- Identify system architecture: monolith, microservices, serverless, hybrid.
- Map critical business flows that must never break (revenue paths, auth, data integrity).
- Catalog existing test infrastructure: frameworks, CI integration, coverage tools.
- Assess current test health: coverage percentage, flake rate, execution time.
- Identify testing gaps by layer (unit, integration, e2e, contract, performance).
Step 2 — Design the Test Pyramid
- Define the unit test layer: pure logic, domain models, utilities — target 70-80% of total tests.
- Define the integration test layer: database queries, API calls, message queues — target 15-20%.
- Define the e2e test layer: critical user journeys only — target 5-10%.
- Add specialized layers as needed: contract tests (APIs), visual regression, accessibility, security.
- Set coverage targets per layer with justification.
Step 3 — Select Testing Patterns
- Choose TDD or BDD based on team maturity and domain complexity.
- Design contract testing strategy for service boundaries (Pact, Spring Cloud Contract).
- Define mutation testing approach for critical modules (Stryker, PIT, mutmut).
- Establish test data management: factories, fixtures, seeding strategies.
- Define mocking boundaries: what to mock, what to use real instances for.
Step 4 — Operationalize the Strategy
- Define CI pipeline test stages: fast feedback (unit) → integration → e2e → deploy.
- Set test quality gates: minimum coverage, zero flakes, mutation score thresholds.
- Create test naming and organization conventions.
- Design test environment provisioning (testcontainers, docker-compose, ephemeral envs).
- Establish test maintenance practices: quarterly flake reviews, coverage ratcheting.
Quality Criteria
- Test pyramid proportions are explicitly stated and justified.
- Critical business flows have end-to-end coverage.
- Contract tests exist at every service boundary.
- Mutation testing validates test effectiveness beyond line coverage.
Anti-Patterns
- Inverted test pyramid (too many e2e, too few unit tests).
- Testing implementation details instead of behavior.
- Ignoring test maintenance cost in the strategy.
- Treating 100% line coverage as a meaningful goal.