qa-testing-strategy

Original🇺🇸 English
Translated

Risk-based quality engineering test strategy for software delivery. Use when defining or updating test strategy, selecting unit/integration/contract/E2E/performance/security coverage, setting CI quality gates and suite budgets, managing flaky tests and test data, and operationalizing observability-first debugging and release criteria.

2installs
Added on

NPX Install

npx skill4agent add vasilyu1983/ai-agents-public qa-testing-strategy

QA Testing Strategy (Jan 2026)

Risk-based quality engineering strategy for modern software delivery.
Core references: curated links in
data/sources.json
(SLOs/error budgets, contracts, E2E, OpenTelemetry). Start with
references/operational-playbook.md
for a compact, navigable overview.

Scope

  • Create or update a risk-based test strategy (what to test, where, and why)
  • Define quality gates and release criteria (merge vs deploy)
  • Select the smallest effective layer (unit → integration → contract → E2E)
  • Make failures diagnosable (artifacts, logs/traces, ownership)
  • Operationalize reliability (flake SLO, quarantines, suite budgets)

Use Instead

NeedSkill
Debug failing tests or incidentsqa-debugging
Test LLM agents/personasqa-agent-testing
Perform security audit/threat modelsoftware-security-appsec
Design CI/CD pipelines and infraops-devops-platform

Quick Reference

Test TypeGoalTypical Use
UnitProve logic and invariants fastPure functions, core business rules
ComponentValidate UI behavior in isolationUI components and state transitions
IntegrationValidate boundaries with real depsAPI + DB, queues, external adapters
ContractPrevent breaking changes cross-teamOpenAPI/AsyncAPI/JSON Schema/Protobuf
E2EValidate critical user journeys1–2 “money paths” per product area
PerformanceEnforce budgets and capacityLoad, stress, soak, regression trends
VisualCatch UI regressionsLayout/visual diffs on stable pages
AccessibilityAutomate WCAG checksaxe smoke + targeted manual audits
SecurityCatch common web vulns earlyDAST smoke + critical checks in CI

Default Workflow

  1. Clarify scope and risk: critical journeys, failure modes, and non-functional risks (latency, data loss, auth).
  2. Define quality signals: SLOs/error budgets, contract/schema checks, and what blocks merge vs blocks deploy.
  3. Choose the smallest effective layer (unit → integration → contract → E2E).
  4. Make failures diagnosable: artifacts + correlation IDs (logs/traces/screenshots), clear ownership, deflake runbook.
  5. Operationalize: flake SLO, quarantine with expiry, suite budgets (PR gate vs scheduled), dashboards.

Test Pyramid

text
           /\
          /E2E\          5-10% - Critical journeys
         /------\
        /Integr. \       15-25% - API, DB, queues
       /----------\
      /Component \       20-30% - UI modules
     /------------\
    /   Unit      \      40-60% - Logic and invariants
   /--------------\

Decision Tree: Test Strategy

text
Need to test: [Feature Type]
    ├─ Pure business logic/invariants? → Unit tests (mock boundaries)
    ├─ UI component/state transitions? → Component tests
    │   └─ Cross-page user journey? → E2E tests
    ├─ API Endpoint?
    │   ├─ Single service boundary? → Integration tests (real DB/deps)
    │   └─ Cross-service compatibility? → Contract tests (schema/versioning)
    ├─ Event-driven/API schema evolution? → Contract + backward-compat tests
    └─ Performance-critical? → k6 load testing

Core QA Principles

Definition of Done

  • Strategy is risk-based: critical journeys + failure modes explicit
  • Test portfolio is layered: fast checks catch most defects
  • CI is economical: fast pre-merge gates, heavy suites scheduled
  • Failures are diagnosable: actionable artifacts (logs/trace/screenshots)
  • Flakes managed with SLO and deflake runbook

Shift-Left Gates (Pre-Merge)

  • Contracts: OpenAPI/AsyncAPI/JSON Schema validation
  • Static checks: lint, typecheck, secret scanning
  • Fast tests: unit + key integration (avoid full E2E as PR gate)

Shift-Right (Post-Deploy)

  • Synthetic checks for critical paths (monitoring-as-tests)
  • Canary analysis: compare SLO signals and key metrics before ramping
  • Feature flags for safe rollouts and fast rollback
  • Convert incidents into regression tests (prefer lower layers first)

CI Economics

BudgetTarget
PR gatep50 ≤ 10 min, p95 ≤ 20 min
Mainline health≥ 99% green builds/day

Flake Management

  • Define: test fails without product change, passes on rerun
  • Track weekly:
    flaky_failures / total_test_executions
    (where
    flaky_failure = fail_then_pass_on_rerun
    )
  • SLO: Suite flake rate ≤ 1% weekly
  • Quarantine policy with owner and expiry
  • Use the deflake runbook: template-flaky-test-triage-deflake-runbook.md

Common Patterns

AAA Pattern

javascript
it('should apply discount', () => {
  // Arrange
  const order = { total: 150 };
  // Act
  const result = calculateDiscount(order);
  // Assert
  expect(result.discount).toBe(15);
});

Page Object Model (E2E)

typescript
class LoginPage {
  async login(email: string, password: string) {
    await this.page.fill('[data-testid="email"]', email);
    await this.page.fill('[data-testid="password"]', password);
    await this.page.click('[data-testid="submit"]');
  }
}

Anti-Patterns

Anti-PatternProblemSolution
Testing implementationBreaks on refactorTest behavior
Shared mutable stateFlaky testsIsolate test data
sleep() in testsSlow, unreliableUse proper waits
Everything E2ESlow, expensiveUse test pyramid
Ignoring flaky testsFalse confidenceFix or quarantine

Do / Avoid

Do

  • Write tests against stable contracts and user-visible behavior
  • Treat flaky tests as P1 reliability work
  • Make "how to debug this failure" part of every suite

Avoid

  • "Everything E2E" as default
  • Sleeps/time-based waits (use event-based)
  • Coverage % as primary quality KPI

Resources

ResourcePurpose
comprehensive-testing-guide.mdEnd-to-end playbook across layers
operational-playbook.mdTesting pyramid, BDD, CI gates
shift-left-testing.mdContract-first, BDD, continuous testing
test-automation-patterns.mdReliable patterns and anti-patterns
playwright-webapp-testing.mdPlaywright patterns
chaos-resilience-testing.mdChaos engineering
observability-driven-testing.mdOpenTelemetry, trace-based
contract-testing-2026.mdPact, Specmatic
synthetic-test-data.mdPrivacy-safe, ephemeral test data

Templates

TemplatePurpose
template-test-case-design.mdGiven/When/Then and test oracles
test-strategy-template.mdRisk-based strategy
template-flaky-test-triage.mdFlake triage runbook
template-jest-vitest.mdUnit test patterns
template-api-integration.mdAPI + DB integration tests
template-playwright.mdPlaywright E2E
template-visual-testing.mdVisual regression testing
template-k6-load-testing.mdk6 performance
automation-pipeline-template.mdCI stages, budgets, gates
template-cucumber-gherkin.mdBDD feature files and steps

Data

FilePurpose
sources.jsonExternal references

Related Skills

  • qa-debugging — Debugging failing tests
  • qa-agent-testing — Testing AI agents
  • software-backend — API patterns to test
  • ops-devops-platform — CI/CD pipelines