tdd

Guide developers through the Red-Green-Refactor cycle with Arrange-Act-Assert tests.

Updated Mar 7, 2026
One-click install
npx skills add https://github.com/ntluong95/agent-skills-statistics --skill tdd-ntluong95
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/ntluong95/agent-skills-statistics/tree/main/.github/skills/common/tdd
Command: npx skills add https://github.com/ntluong95/agent-skills-statistics --skill tdd-ntluong95

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill ensures code quality and reliability by enforcing a structured approach to writing tests before or alongside production code, preventing bugs and improving maintainability.

Core Features & Use Cases

  • Test-Driven Development Cycle: Guides users through the Red-Green-Refactor process.
  • AAA Structure Enforcement: Mandates the Arrange-Act-Assert pattern for clear, focused tests.
  • Coverage Standards: Sets minimum and target code coverage thresholds.
  • Use Case: When developing a new API endpoint, use this Skill to write a failing test for the expected success response, then implement the minimal code to pass, and finally refactor both test and code.

Quick Start

Follow the Red-Green-Refactor cycle for all new code development.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I write unit tests using the Red-Green-Refactor cycle?

Test-driven development enforces the Arrange-Act-Assert structure to keep unit tests clear and focused. This Skill mandates the AAA pattern, requiring you to set up conditions, execute the action, and verify the expected behavior for every test.

How do I set code coverage thresholds for unit tests?

Code coverage thresholds define minimum and target percentages of code that must be tested. This Skill sets clear coverage standards, helping you enforce quality metrics and prevent bugs by ensuring adequate test coverage across your production code.

Does test-driven development work with different programming languages and testing frameworks?

Test-driven development principles apply across various programming languages and their respective testing frameworks. This Skill supports multiple language environments, enforcing TDD practices regardless of your specific tech stack or framework choice.

When should I use test-driven development for writing code?

Test-driven development should be used when developing new features like API endpoints to prevent bugs and improve maintainability. This Skill ensures code quality by enforcing a structured approach to writing tests before or alongside your production code implementation.