Testing Strategy

July 23, 2026 · View on GitHub

The Absolute Rule

ALL TESTS MUST PASS. NO EXCEPTIONS.

This is not negotiable. This is not flexible. This is absolute.

Not acceptable excuses:

  • "Those tests were already failing" -> Then fix them first
  • "That's not related to my changes" -> Doesn't matter, fix it
  • "It's flaky, just ignore it" -> Flaky = bug, investigate it
  • "It passes locally" -> CI is the source of truth

The process:

  1. Tests fail -> STOP
  2. Investigate -> Find root cause
  3. Fix -> Whatever is actually broken
  4. All tests pass -> THEN commit

Meta-Testing Challenge

This is a meta-project - it's a wizard that sets up other projects. Traditional testing doesn't directly apply.

Normal ProjectThis Project
Test source codeTest wizard installation
Unit test functionsTest script logic
Integration test APIsTest workflow behavior
E2E test user flowsSimulate wizard usage

Test Files

Layer 1: Script Logic Tests

Test FileTestsWhat It Covers
tests/test-version-logic.shVersion comparisonSemver parsing, upgrade detection
tests/test-analysis-schema.shSchema validationJSON analysis response format
tests/test-workflow-triggers.shWorkflow triggersDispatch, schedule, event configs
tests/test-cusum.shCUSUM drift detectionThreshold alerts, status tracking
tests/test-stats.shStatistical functionsCI calculation, n=1 handling, compare_ci
tests/test-hooks.shHook scriptsOutput keywords, JSON format, TDD checks
tests/test-compliance.shCompliance checkerComplexity extraction, pattern matching
tests/test-evaluate-bugs.shEvaluate bug regressionRegression tests for evaluate.sh bugs
tests/test-score-analytics.shScore analyticsHistory parsing, trends, reports
tests/test-domain-detection.shDomain detectionDomain-adaptive testing layers, detection patterns, fixture validation
tests/test-autocompact-methodology.shAutocompact benchmarking methodologyMethodology rigor, harness quality, task suite, canary facts
tests/test-node24-compliance.shNode 24 complianceNo deprecated node20 actions, correct versions, no node-version: 20
tests/test-effectiveness-scoreboard.shEffectiveness scoreboardSeed data quality, DDE calculation, escape rate, analytics output
tests/test-firmware-fixture.shFirmware fixtureDomain indicators, Python overlay, test infra, multi-device, no-web negative test
tests/test-doc-consistency.shDoc consistencyWorkflow/file/skill/scenario counts match filesystem, no stale hardcoded counts; wizard-doc effort-section hardening (adaptive thinking, Pro/Max scope, anti-laziness mechanisms)

How to run:

./tests/test-version-logic.sh
./tests/test-analysis-schema.sh
./tests/test-workflow-triggers.sh
./tests/test-cusum.sh
./tests/test-stats.sh
./tests/test-hooks.sh
./tests/test-compliance.sh
./tests/test-evaluate-bugs.sh
./tests/test-score-analytics.sh
./tests/test-domain-detection.sh
./tests/test-autocompact-methodology.sh
./tests/test-node24-compliance.sh
./tests/test-firmware-fixture.sh

Layer 2: Fixture Validation

Location: tests/fixtures/releases/

What they test:

  • Analysis response format
  • Relevance categorization (HIGH/MEDIUM/LOW)
  • Required JSON fields present

Layer 3: E2E Simulation

Location: tests/e2e/

What it tests:

  • Wizard installation on test repo
  • SDLC compliance during tasks
  • Hook firing behavior
  • Scoring criteria (10 checks across 7 categories, up to 11 points on UI scenarios)

How to run:

./tests/e2e/run-simulation.sh

Falls back to validation-only mode (checks fixtures/scenarios, no live run) if the claude CLI isn't on PATH. Otherwise runs the full simulation via claude --print on your authenticated CLI session — no ANTHROPIC_API_KEY needed or read.

Layer 4: SDP / Statistical Validation

Test FileTestsWhat It Covers
tests/test-sdp-calculation.shSDP scoringRaw/adjusted, caps, robustness, interpretations
tests/test-external-benchmark.shExternal benchmarksSource fallback, caching, model mapping

These validate the model-adjusted scoring that distinguishes "model issues" from "wizard issues".

How to run:

./tests/test-sdp-calculation.sh
./tests/test-external-benchmark.sh

Layer 5: E2E Tests

Location: tests/e2e/

Test FileWhat It Covers
tests/e2e/test-json-extraction.shJSON parsing utilities
tests/e2e/test-multi-call-eval.shPer-criterion prompts + aggregation
tests/e2e/test-eval-prompt-regression.shGolden output validation
tests/e2e/test-eval-validation.shSchema/bounds validation
tests/e2e/test-deterministic-checks.shGrep-based scoring checks
tests/e2e/test-pairwise-compare.shPairwise tiebreaker logic
tests/e2e/test-scenario-rotation.shScenario selection/rotation
tests/e2e/test-simulation-prompt.shSimulation prompt construction
./tests/e2e/test-json-extraction.sh
./tests/e2e/test-multi-call-eval.sh
./tests/e2e/test-eval-prompt-regression.sh
./tests/e2e/test-eval-validation.sh
./tests/e2e/test-deterministic-checks.sh
./tests/e2e/test-pairwise-compare.sh
./tests/e2e/test-scenario-rotation.sh
./tests/e2e/test-simulation-prompt.sh

E2E Library Scripts

These are sourced by tests and workflows, not run directly:

ScriptPurpose
tests/e2e/lib/stats.sh95% CI calculation, t-distribution, compare_ci
tests/e2e/lib/json-utils.shJSON extraction from Claude output
tests/e2e/lib/external-benchmark.shMulti-source benchmark fetcher
tests/e2e/lib/sdp-score.shSDP calculation logic
tests/e2e/lib/eval-criteria.shPer-criterion prompts + aggregation (v3)
tests/e2e/lib/eval-validation.shSchema/bounds validation + prompt version
tests/e2e/lib/deterministic-checks.shGrep-based scoring (task_tracking, confidence, tdd_red)
tests/e2e/lib/scenario-selector.shScenario auto-discovery and rotation
tests/e2e/evaluate.shAI-powered SDLC scoring (0-10, up to 11 for UI scenarios)
tests/e2e/check-compliance.shPattern-based compliance checks
tests/e2e/cusum.shCUSUM drift detection (total + per-criterion)
tests/e2e/run-simulation.shE2E test runner
tests/e2e/run-tier2-evaluation.sh5-trial statistical evaluation
tests/e2e/pairwise-compare.shPairwise tiebreaker comparison
tests/e2e/score-analytics.shScore history analytics and trends

Test Scenarios

ScenarioComplexityFile
Typo FixSimpletests/e2e/scenarios/simple-typo-fix.md
Add Feature (original)Mediumtests/e2e/scenarios/add-feature.md
Add Feature (medium)Mediumtests/e2e/scenarios/medium-add-feature.md
Fix BugMediumtests/e2e/scenarios/fix-bug.md
Refactor (original)Mediumtests/e2e/scenarios/refactor.md
Refactor (hard)Hardtests/e2e/scenarios/hard-refactor.md
Version UpgradeMediumtests/e2e/scenarios/version-upgrade.md
UI StylingMediumtests/e2e/scenarios/ui-styling-change.md
UI ComponentMediumtests/e2e/scenarios/add-ui-component.md
Tool PermissionsMediumtests/e2e/scenarios/tool-permissions.md
Multi-File API EndpointMediumtests/e2e/scenarios/multi-file-api-endpoint.md
Production Bug InvestigationHardtests/e2e/scenarios/production-bug-investigation.md
Technical Debt CleanupMediumtests/e2e/scenarios/technical-debt-cleanup.md
Expand Test CoverageMediumtests/e2e/scenarios/expand-test-coverage.md
Add Batch OperationsMediumtests/e2e/scenarios/add-batch-operations.md
Add Task PersistenceMediumtests/e2e/scenarios/add-task-persistence.md

CI Integration

Tests run automatically on:

  • Every pull request
  • Push to main branch

CI runs:

  1. YAML validation
  2. Shell script checks
  3. Prompt file validation
  4. State file validation
  5. All Layer 1 script tests
  6. E2E fixture validation (Layer 3)
  7. E2E quick check (Tier 1, 1x run)
  8. E2E full evaluation (Tier 2, 5x runs, on merge-ready label)

Manual Testing

Workflows require the GitHub Actions environment (secrets, runner context, claude-code-action@v1). They cannot be tested locally with act.

What you can test locally:

# YAML syntax validation
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/ci.yml'))"

# All script-based tests (no API key needed)
./tests/test-version-logic.sh && ./tests/test-analysis-schema.sh

# E2E simulation (full run requires an authenticated Claude Code CLI)
./tests/e2e/run-simulation.sh

Playwright MCP vs Playwright Tests

They are different tools for different jobs. Don't confuse them.

Playwright MCP (debugging)Playwright Test Framework (automation)
WhatMCP server Claude uses to interact with a live browserAutomated test runner (npx playwright test)
WhenDebugging a visual issue, inspecting DOM state, verifying a fix looks rightRegression testing on every PR, CI gating
Who runs itClaude (via MCP tool calls during a conversation)CI pipeline (headless, no human)
RepeatableNo — interactive, exploratory, one-offYes — deterministic, runs the same every time
ReplacesA human opening DevTools to inspect the pageNothing — this IS the automated test layer

Playwright MCP replaces a human doing visual testing. Instead of you opening a browser, clicking around, and eyeballing whether things look right — Claude does it. For any web project, this is huge:

  • "Does this CSS change actually look right?" — Claude screenshots it and tells you
  • "Is the modal centered on mobile?" — Claude resizes the viewport and checks
  • "Click through the checkout flow and tell me what breaks" — Claude does it like a QA tester would
  • "What's the DOM state after this interaction?" — Claude inspects it like DevTools

It does NOT replace npx playwright test. Automated browser regression tests must:

  • Run headless in CI on every PR
  • Cover critical user flows (login, checkout, form submission)
  • Catch regressions without human intervention
  • Produce deterministic pass/fail results

The rule: Use Playwright MCP to debug and verify during development. Use Playwright tests to prevent regressions in CI. If someone tells you "we have Playwright MCP so we don't need E2E tests" — that's like saying "I have Chrome DevTools so I don't need a test suite."

Known Gaps

Cannot Fully Test in CI

  • Real interactive hook firing inside live user sessions
  • PR/issue creation side effects (requires repo permissions)

What CI Does Test

  • Script-level tests use fixtures (no API key needed)
  • E2E quick-check and full-evaluation run real Claude API simulations on PRs
  • Structure, logic, and scoring validation on every push