tdd
SolidAI DevKit · Test-driven development — write a failing test before writing production code. Use when implementing new functionality, adding behavior, or fixing bugs during active development.
AI & Automation 1,587 stars
243 forks Updated today
Install
Quality Score: 81/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# TDD
Red. Green. Refactor. In that order, every time.
## Hard Rules
- No production code without a failing test first.
- If production code was written before its test, delete it and start over with a failing test.
- Never skip the red step. A test that has never failed proves nothing.
## Cycle
For each unit of behavior:
1. **Red** — Write a test for the next behavior. Run it. It must fail. Read the failure message — it should describe the missing behavior.
2. **Green** — Write the minimum production code to make the test pass. Nothing more. Run the test. Apply the `verify` skill.
3. **Refactor** — Clean up both test and production code. Run the test again. Still green? Done. Apply the `verify` skill.
Then pick the next behavior and repeat.
## Rules for Each Step
**Red:**
- Test one behavior, not one function. Name the test after what the system should do, not what the function is called.
- The test must fail for the right reason — a missing method, wrong return value, unmet condition. Not a syntax error or import failure.
- If the test passes immediately, it's not testing new behavior. Delete it or pick a different behavior.
**Green:**
- Write the simplest code that passes. Hardcode if needed — the next test will force generalization.
- Do not add code "while you're in there." If it's not required by a failing test, it doesn't exist yet.
- Do not refactor during green. Pass first, clean second.
**Refactor:**
- Remove duplication between test and production code.
...
Details
- Author
- codeaholicguy
- Repository
- codeaholicguy/ai-devkit
- Created
- 10 months ago
- Last Updated
- today
- Language
- TypeScript
- License
- None
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Solid
tdd
Test-driven development — write a failing test that names the behavior, watch it fail, implement the minimum to make it pass, then refactor with tests green. Works for new features, bug fixes, and behavior changes. Use when the user says "tdd", "test-first", "write tests first", or wants a change built test-first.
74 Updated today
genai-io AI & Automation Listed
test-driven-development
Use when implementing any feature or bugfix, before writing implementation code
0 Updated today
SohailKhan0525 AI & Automation Listed
test-driven-development
Use when implementing any feature or bugfix, before writing implementation code
1 Updated 1 weeks ago
angyal168