Test-Driven Development

Guide developers through Test-Driven Development with vertical slices and refactoring.

27|3|Updated Jun 5, 2018
One-click install
npx skills add https://github.com/iggredible/dotfiles --skill test-driven-development-iggredible
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Test-Driven Development
Source: https://github.com/iggredible/dotfiles/tree/main/.claude/skills/tdd
Command: npx skills add https://github.com/iggredible/dotfiles --skill test-driven-development-iggredible

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers write higher-quality, more maintainable code by adhering to Test-Driven Development (TDD) principles, reducing bugs and improving design.

Core Features & Use Cases

  • TDD Workflow Guidance: Provides a structured approach to writing tests before implementation.
  • Design Principles: Emphasizes writing testable code and designing for deep modules.
  • Anti-Pattern Avoidance: Warns against common pitfalls like horizontal slicing and testing implementation details.
  • Use Case: A developer is starting a new feature and wants to ensure they follow best practices for testing and code design from the outset.

Quick Start

Follow the TDD workflow outlined in this skill to develop a new feature.

Frequently Asked Questions about Test-Driven Development

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is Test-Driven Development and how does it improve code quality?

Test-Driven Development (TDD) is a methodology where you write tests before implementation to produce robust, maintainable software. It improves code quality by enforcing testable designs and reducing bugs through structured refactoring.

How do I start writing tests before implementation for a new feature?

To start writing tests before implementation, follow the TDD workflow by building vertical slices and using tracer bullets. This approach ensures you design for testability from the outset and avoid horizontal slicing anti-patterns.

Why should I avoid testing implementation details in software development?

You should avoid testing implementation details because it creates brittle tests that break during refactoring. Focusing on result-oriented functions and dependency injection ensures your tests validate behavior rather than internal mechanics.

What's the best way to design testable code using dependency injection?

The best way to design testable code is using dependency injection to create deep modules and result-oriented functions. This allows you to isolate components during testing and supports the vertical slicing approach.

When should I use vertical slices instead of horizontal slicing in TDD?

Use vertical slices in TDD when building new features end-to-end, as it delivers functional tracer bullets through all layers. Horizontal slicing is an anti-pattern that delays integration and defers testing of component interactions.