| name | shift-left-testing |
| description | Move testing activities earlier in the development lifecycle to catch defects when they're cheapest to fix. Use when implementing TDD, CI/CD, or early quality practices. |
| category | testing-methodologies |
| priority | high |
| tokenEstimate | 900 |
| agents | ["qe-test-generator","qe-requirements-validator","qe-regression-risk-analyzer"] |
| implementation_status | optimized |
| optimization_version | 1 |
| last_optimized | "2025-12-02T00:00:00.000Z" |
| dependencies | [] |
| quick_reference_card | true |
| tags | ["shift-left","early-testing","tdd","bdd","ci-cd","prevention"] |
| trust_tier | 3 |
| validation | {"schema_path":"schemas/output.json","validator_path":"scripts/validate-config.json","eval_path":"evals/shift-left-testing.yaml"} |
Shift-Left Testing
<default_to_action>
When implementing early testing practices:
- VALIDATE requirements before coding (testability, BDD scenarios)
- WRITE tests before implementation (TDD)
- AUTOMATE in CI pipeline (every commit triggers tests)
- FIX defects immediately - never let them accumulate
Quick Shift-Left Levels:
- Level 1: Unit tests with each PR (developer responsibility)
- Level 2: TDD practice (tests before code)
- Level 3: BDD/Example mapping in refinement (requirements testing)
- Level 4: Risk analysis in design (architecture testing)
</default_to_action>
Quick Reference Card
When to Use
- Reducing cost of defects
- Implementing CI/CD pipelines
- Starting TDD practice
- Improving requirements quality
Shift-Left Levels
| Level | Practice | When |
|---|
| 1 | Unit tests in PR | Before merge |
| 2 | TDD | Before implementation |
| 3 | BDD/Example Mapping | During refinement |
| 4 | Risk Analysis | During design |
Level 1: Tests in Every PR
name: CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npm run test:unit