---
name: Test-Driven Development
slug: test-driven-development-15
category: Quality
description: Test-Driven Development uses a red-green-refactor cycle before implementation code is written. Use it for new features, bug fixes, and behavior-changing refactors.
github: "https://github.com/peintune/runjam/tree/main/src-tauri/builtin-skills/test-driven-development"
language: Rust
stars: 195
forks: 12
install: "npx degit https://github.com/peintune/runjam/tree/main/src-tauri/builtin-skills/test-driven-development ~/.claude/skills/test-driven-development"
installs_to: ~/.claude/skills/test-driven-development
source_path: src-tauri/builtin-skills/test-driven-development/SKILL.md
collection_size: 13
category_size: 1745
collection_url: "https://dirskills.com/collections/peintune/runjam"
added: 2026-09-06T05:18:58.864Z
last_synced: 2026-09-06T05:18:58.864Z
canonical_url: "https://dirskills.com/skills/test-driven-development-15"
---

# Test-Driven Development

Test-Driven Development uses a red-green-refactor cycle before implementation code is written. Use it for new features, bug fixes, and behavior-changing refactors.

**Install:**

```bash
npx degit https://github.com/peintune/runjam/tree/main/src-tauri/builtin-skills/test-driven-development ~/.claude/skills/test-driven-development
```

## README

# Test-Driven Development (TDD)

## Rule

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.

## When to Use

Always for:
- New features
- Bug fixes
- Refactoring with behavior changes

Skip only for:
- Config file changes
- Documentation updates
- Non-functional changes (formatting, comments)

## Process

1. **Red**: Write a failing test
2. **Green**: Write minimal code to pass
3. **Refactor**: Clean up while keeping tests green

## Anti-Patterns

- Writing implementation before the test
- Skipping the "watch it fail" step
- Writing tests that are too coupled to implementation
- Testing framework behavior instead of your code
