test-driven-development

Guide the red-green-refactor cycle by writing failing tests before production code.

2|Updated Apr 20, 2026
One-click install
npx skills add https://github.com/FelixBitSoul/contentCrew-AI --skill test-driven-development-felixbitsoul
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/FelixBitSoul/contentCrew-AI/tree/main/.trae/skills/test-driven-development
Command: npx skills add https://github.com/FelixBitSoul/contentCrew-AI --skill test-driven-development-felixbitsoul

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

在实现任何功能前编写测试,强制进行设计评估和早期回归检测,减少缺陷并提升代码质量。

Core Features & Use Cases

  • 提示并引导红绿测试循环(红灯–失败测试,绿灯–最小实现,重构–代码清理)。
  • 适用于新功能、Bug 修复、以及行为重构等场景,确保开发以测试驱动。
  • 提供清晰的测试设计原则与最佳实践示例,帮助团队落地 TDD 流程。

Quick Start

先写一个失败的测试来描述期望行为,然后编写最少量的生产代码以使测试通过,最后进行重构以保持测试通过。

Frequently Asked Questions about test-driven-development

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 enforces test-first workflows by requiring a failing test before any production code. It applies the red-green-refactor cycle to new features, bug fixes, and refactoring, ensuring early regression detection and incremental implementation across supported languages.

How do I start writing failing tests before implementing production code?▼

Start test-driven development by writing a failing test that describes expected behavior, observing the failure, implementing minimal production code to pass the test, and refactoring the code while keeping all tests green for incremental implementation.

Can I apply test-driven development to bug fixes and behavior refactoring?▼

Yes, test-driven development applies to bug fixes and behavior refactoring across languages where tests are used. You write a failing test defining the expected behavior, implement minimal code to pass it, and refactor while keeping tests green.

What are the best practices for explicit test design in software engineering?▼

Test-driven development best practices include following the red-green-refactor cycle, designing explicit tests for incremental implementation, and writing minimal production code to pass tests. This test-first workflow enforces design evaluation, reduces defects, and improves software quality.

When should I not use a test-first workflow for new features?▼

Avoid test-driven development in languages or environments where automated tests are not feasible, or when rapid exploratory prototyping is required. The test-first workflow enforces design evaluation and minimal implementation, which may slow down early experimental coding phases.