tdd

Enforce red-green-refactor testing loops for disciplined software development.

Updated Mar 19, 2026
One-click install
npx skills add https://github.com/Mrlyk/SKILLS --skill tdd-mrlyk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/Mrlyk/SKILLS/tree/main/skills/tdd
Command: npx skills add https://github.com/Mrlyk/SKILLS --skill tdd-mrlyk

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

测试驱动开发(TDD)帮助在实现前通过测试来定义系统行为,降低回归风险并引导设计。通过红-绿-重构循环实现高质量代码,确保开发过程可验证且易于维护。

Core Features & Use Cases

  • Red-Green-Refactor workflow:先编写失败的测试,再实现最少代码使测试通过,最后重构以改善设计。
  • Testing-directed design:测试描述系统行为而非实现细节,促进模块解耦和接口清晰。
  • Incremental delivery:适用于新特性和缺陷修复的增量开发,确保每次提交都经过测试。

Quick Start

Begin by writing a failing test for a small feature, then implement the minimal code to pass.

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 loop work?

Test-driven development defines system behavior through tests before implementation. The red-green-refactor loop involves writing a failing test, implementing minimal code to pass it, and then refactoring to improve design while maintaining correct behavior.

How do I start writing unit tests for a new feature using test-first workflows?

Begin unit testing by writing a small failing test for the feature, then implement the minimal code required to make the test pass. This incremental delivery ensures every feature submission is verified through isolated public interfaces.

Can I use test-driven development for both new features and bug fixes?

Yes, test-driven development applies to both new features and bug fixes. It enforces incremental implementation through testing-first workflows, ensuring that defect resolution and feature delivery are continuously verified through unit tests.

How does testing-directed design improve software quality and module decoupling?

Testing-directed design improves software quality by describing system behavior rather than implementation details. This approach naturally promotes module decoupling and ensures isolated public interfaces, leading to maintainable code.

What are the limitations of using test-driven development for isolated public interfaces?

Test-driven development requires disciplined adherence to the red-green-refactor cycle. While it reduces regression risk for isolated public interfaces, it demands consistent incremental implementation and may not suit rapidly changing architectural prototypes.