tdd

Guide test-first implementation through the RED→GREEN→REFACTOR cycle.

9|Updated Jan 18, 2025
One-click install
npx skills add https://github.com/TheNordicOne/ngx-formbar --skill tdd-thenordicone
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/TheNordicOne/ngx-formbar/tree/main/.claude/skills/tdd
Command: npx skills add https://github.com/TheNordicOne/ngx-formbar --skill tdd-thenordicone

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Test-Driven Development helps you implement behavior safely by writing tests first, preventing regressions, and guiding design toward testable interfaces.

Core Features & Use Cases

  • Vertical slicing workflow: implement one behavior end-to-end per cycle instead of batching tests or implementations.
  • Tracer bullet iteration: start with a single end-to-end test to prove the path works before expanding coverage.
  • Refactor with guardrails: refactor only after reaching GREEN, keeping tests as the specification.
  • Interface-first for testability: design dependencies and outputs to make mocking and verification straightforward.

Quick Start

Ask the AI to apply TDD by outlining the first behavior to test, then producing the minimal RED→GREEN→REFACTOR cycle for that behavior using tracer bullets.

Frequently Asked Questions about tdd

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

FAQPage Schema
What is test-driven development and how does the red-green-refactor cycle work?

Test-driven development is a test-first implementation approach using the red-green-refactor cycle to arrive at behaviorally correct code. You write a failing test, produce minimal code to pass it, then safely refactor only after reaching green.

How do I implement a new feature using test-driven development?

To implement a feature using test-driven development, apply vertical slicing by outlining one behavior end-to-end and creating a single focused test. Use tracer bullets to prove the path works, write minimal code to satisfy the current test, then refactor with guardrails.

When should I use test-first implementation instead of writing tests after coding?

Use test-first implementation when adding new features or fixing bugs to prevent regressions and guide design toward testable interfaces. Applying test-driven development helps you implement behavior safely by verifying through public interfaces before expanding coverage.

Can I use mocking and specification-by-example with this test-driven development workflow?

Yes, this test-driven development workflow supports mocking and specification-by-example. It emphasizes interface-first design for testability, ensuring dependencies and outputs are structured to make mocking and verification straightforward during the red-green-refactor cycle.

What are the limitations of test-driven development for complex implementations?

A limitation of test-driven development is that refactoring is restricted to after reaching green, and it requires vertical slicing. You must implement one behavior per cycle and verify through public interfaces, avoiding batched tests or premature refactoring that breaks the specification guardrails.