test-driven-development

Guide Test-Driven Development with the RED-GREEN-REFACTOR cycle.

Updated May 25, 2026
One-click install
npx skills add https://github.com/huuhiep0303/s-tools --skill test-driven-development-huuhiep0303
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/huuhiep0303/s-tools/tree/main/.agents/skills/test-driven-development
Command: npx skills add https://github.com/huuhiep0303/s-tools --skill test-driven-development-huuhiep0303

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill guides the implementation of Test-Driven Development (TDD) practices, helping developers write code that is more robust, maintainable, and reliable.

Core Features & Use Cases

  • TDD Overview: Introduces the concept of TDD and its importance in software development.
  • When to Use: Provides scenarios where TDD is most beneficial, including bug fixes, feature implementation, and code modifications.
  • TDD Cycle: Explains the three-step process of RED (Write a failing test), GREEN (Make it pass), and REFECTOR (Clean up).
  • Prove-It Pattern: Describes how to use TDD for bug fixes, starting with writing a test to reproduce the bug.
  • Test Pyramid: Discusses the different types of tests (unit, integration, end-to-end) and their relative importance.
  • Writing Good Tests: Offers guidelines for writing effective tests, including state assertions, DAMP over DRY, and real implementations over mocks.
  • Test Anti-Patterns: Warns against common pitfalls in testing to avoid potential issues.

Quick Start

Follow the TDD cycle by writing a failing test before writing the code that makes it pass, and refactor as needed.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
What is the test-driven development cycle for writing reliable code?

The test-driven development cycle follows a three-step process: RED to write a failing test, GREEN to implement code that passes the test, and REFACTOR to clean up the code for better maintainability.

When should I use TDD practices in software development?

TDD practices are most beneficial when implementing new features, modifying existing code, or fixing bugs using the Prove-It pattern, which starts by writing a test to reproduce the bug before fixing it.

How do I write high-quality tests for test-driven development?

High-quality tests in test-driven development use state assertions, favor DAMP over DRY principles for readability, and prefer real implementations over mocks to cover a wide range of scenarios effectively.

What are common test anti-patterns to avoid in TDD?

Test anti-patterns in TDD include common pitfalls in writing tests that can cause potential issues, and developers are warned against these practices to ensure tests remain effective and code quality improves.

Does test-driven development require a specific test pyramid structure?

Test-driven development utilizes the Test Pyramid, which discusses the relative importance of unit, integration, and end-to-end tests to ensure comprehensive software testing and reliability.