← ClaudeAtlas

testing-strategylisted

Comprehensive testing skill covering unit, integration, and e2e testing with TDD. Use when writing tests, improving coverage, or setting up testing infrastructure. Keywords: test, TDD, unit test, integration, e2e, coverage, mock, jest, vitest
cheemsiulord/KILO-KIT · ★ 0 · Testing & QA · score 78
Install: claude install-skill cheemsiulord/KILO-KIT
# 🧪 Testing Strategy Skill > **Philosophy:** If it's not tested, it's broken. You just don't know it yet. ## When to Use Use this skill when: - Writing new code (TDD approach) - Adding tests to existing code - Improving test coverage - Fixing flaky tests - Setting up testing infrastructure - Debugging test failures **Do NOT use this skill when:** - Just running existing tests - Quick syntax check --- ## The Testing Pyramid ``` ╱╲ ╱ ╲ ╱ E2E╲ Few, slow, expensive ╱──────╲ Full system tests ╱ ╲ ╱Integration╲ Medium amount ╱────────────╲ Component interaction ╱ ╲ ╱ Unit Tests ╲ Many, fast, cheap ╱──────────────────╲ Single unit isolation ``` --- ## TDD Workflow: RED → GREEN → REFACTOR ### Step 1: RED (Write Failing Test) ```typescript // Write the test BEFORE the implementation describe('calculateDiscount', () => { it('should apply 10% discount for orders over $100', () => { // This test will FAIL because function doesn't exist yet const result = calculateDiscount(150); expect(result).toBe(135); }); }); ``` **Run test → Should FAIL (RED)** ### Step 2: GREEN (Minimal Implementation) ```typescript // Write the MINIMUM code to pass the test function calculateDiscount(amount: number): number { if (amount > 100) { return amount * 0.9; } return amount; } ``` *