test-driven-development

Enforce the London School TDD cycle with mock-first failing tests.

1|1|Updated May 1, 2025
One-click install
npx skills add https://github.com/jimweller/dotfiles --skill test-driven-development-jimweller
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/jimweller/dotfiles/tree/main/dotfiles/claude-code/skills/test-driven-development
Command: npx skills add https://github.com/jimweller/dotfiles --skill test-driven-development-jimweller

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill enforces a rigorous Test-Driven Development (TDD) process, ensuring that all production code is written only after a failing test has been created, thereby preventing bugs and improving code reliability.

Core Features & Use Cases

  • Mandatory Test-First Approach: Enforces writing tests before any implementation code.
  • Red-Green-Refactor Cycle: Guides users through the TDD loop: write a failing test (Red), write minimal code to pass (Green), then clean up (Refactor).
  • Mocking Strategy: Emphasizes the London School of TDD, advocating for mocking collaborators to isolate the unit under test.
  • Use Case: When developing a new user authentication feature, you would first write a test that asserts a user cannot log in with invalid credentials. Only after this test fails would you write the code to handle invalid logins.

Quick Start

Follow the Red-Green-Refactor cycle for all new features and bug fixes.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I start writing failing tests before implementation code?

To start writing failing tests before implementation, follow the Red-Green-Refactor cycle by writing a failing test first, creating minimal code to pass it, and then refactoring. This test-first approach ensures code reliability and prevents bugs.

What is the London School TDD methodology for software development?

The London School TDD methodology is a test-first software development approach emphasizing mock-first strategies. It isolates the unit under test by mocking collaborators, ensuring rigorous code quality and preventing regressions when building new features or fixing bugs.

How does the Red-Green-Refactor cycle work for agile refactoring?

The Red-Green-Refactor cycle works by first writing a failing test for new features or bug fixes, then writing minimal implementation code to make it pass, and finally cleaning up the code through refactoring while ensuring the tests continue to pass.

Do I need to use mocking to isolate units when following a test-first approach?

Yes, you need to use mocking to isolate units when following this test-first approach. The methodology emphasizes the London School of TDD, advocating for mocking collaborators to strictly isolate the unit under test and ensure accurate code quality verification.

When should I not use a test-first strategy for refactoring?

You should not avoid a test-first strategy for refactoring, as this methodology mandates it. It enforces a test-first approach for all software development tasks, including new features, bug fixes, and refactoring, to strictly prevent regressions and maintain code quality.