tdd

Drive software development through a red-green-refactor loop with vertical slices.

2|Updated Jul 11, 2024
One-click install
npx skills add https://github.com/nicograef/handbook --skill tdd-nicograef
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/nicograef/handbook/tree/main/.claude/skills/tdd
Command: npx skills add https://github.com/nicograef/handbook --skill tdd-nicograef

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the common pitfalls of test-driven development, such as horizontal slicing and improper mocking, by enforcing a disciplined, vertical-slice approach to software construction.

Core Features & Use Cases

  • Vertical Slicing: Guides you through the tracer bullet workflow, ensuring each test corresponds to a single, minimal implementation step.
  • Mocking Guidelines: Provides clear rules on when to mock at system boundaries versus when to use real objects, preventing brittle test suites.
  • Refactoring Discipline: Enforces the rule of only refactoring while in a GREEN state, ensuring code quality improvements never break existing functionality.

Quick Start

Initiate the tdd skill to plan a new feature by listing the behaviors to test and confirming the public interface design.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I implement test-driven development using a red-green-refactor loop?

Test-driven development using a red-green-refactor loop drives software construction through vertical slices, ensuring each test corresponds to a single, minimal implementation step for high-quality code.

When should I use mocking versus real objects in software testing?

Mocking in software testing should be applied strictly at system boundaries to prevent brittle test suites, whereas real objects should be used internally to ensure accurate behavior verification.

What is the best way to apply vertical slicing in test-first development?

The best way to apply vertical slicing in test-first development is the tracer bullet workflow, which guides you to list behaviors to test and confirm the public interface design before minimal implementation.

Why does refactoring discipline require a GREEN state in TDD?

Refactoring discipline requires a GREEN state in TDD to ensure code quality improvements never break existing functionality, enforcing strict adherence to SOLID principles while maintaining observable behavior testing.

Can I use this TDD approach for both feature implementation and bug fixing?

Yes, you can use this TDD approach for both feature implementation and bug fixing tasks, as it mandates observable behavior testing and enforces a disciplined, vertical-slice approach to software construction.

What are the limitations of horizontal slicing in test-driven development?

Horizontal slicing in test-driven development leads to common pitfalls like improper mocking and architectural disconnect, which this approach avoids by enforcing a disciplined, vertical-slice tracer bullet workflow.