tdd

Solid

Test-driven development workflow with philosophy guide - plan → write tests → implement → validate

Testing & QA 3,795 stars 297 forks Updated 4 months ago MIT

Install

View on GitHub

Quality Score: 86/100

Stars 20%
100
Recency 20%
50
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# /tdd - Test-Driven Development Workflow Strict TDD workflow: tests first, then implementation. ## When to Use - "Implement X using TDD" - "Build this feature test-first" - "Write tests for X then implement" - Any feature where test coverage is critical - Bug fixes that need regression tests --- # TDD Philosophy ## Overview Write the test first. Watch it fail. Write minimal code to pass. **Core principle:** If you didn't watch the test fail, you don't know if it tests the right thing. **Violating the letter of the rules is violating the spirit of the rules.** ## The Iron Law ``` NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST ``` Write code before the test? Delete it. Start over. **No exceptions:** - Don't keep it as "reference" - Don't "adapt" it while writing tests - Don't look at it - Delete means delete Implement fresh from tests. Period. ## Red-Green-Refactor ### RED - Write Failing Test Write one minimal test showing what should happen. **Good:** ```typescript test('retries failed operations 3 times', async () => { let attempts = 0; const operation = () => { attempts++; if (attempts < 3) throw new Error('fail'); return 'success'; }; const result = await retryOperation(operation); expect(result).toBe('success'); expect(attempts).toBe(3); }); ``` Clear name, tests real behavior, one thing. **Bad:** ```typescript test('retry works', async () => { const mock = jest.fn() .mockRejectedValueOnce(new Error()) .mockResolved...

Details

Author
parcadei
Repository
parcadei/Continuous-Claude-v3
Created
5 months ago
Last Updated
4 months ago
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category