test-driven-development

Enforce the red-green-refactor cycle for tests before production code.

121|12|Updated Nov 16, 2022
One-click install
npx skills add https://github.com/bartstc/vite-ts-react-template --skill test-driven-development-bartstc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/bartstc/vite-ts-react-template/tree/main/.agents/skills/test-driven-development
Command: npx skills add https://github.com/bartstc/vite-ts-react-template --skill test-driven-development-bartstc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TDD helps teams ensure software correctness by requiring a failing test before implementing production code.

Core Features & Use Cases

  • Enforce the red-green-refactor cycle across features, bug fixes, and refactors.
  • Provide guidelines for when to use TDD and how to write minimal, purposeful tests.
  • Improve code quality and maintainability by catching regressions early.

Quick Start

Write a failing test for a small feature, then implement the minimal production code to pass, and refactor.

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 it ensure code correctness?

Test-driven development is a process requiring a failing test before implementing production code to ensure software correctness. It drives minimal, focused tests to catch regressions early and improve maintainability across new features and bug fixes.

How do I apply the red-green-refactor cycle when writing unit tests?

To apply the red-green-refactor cycle for unit testing, write a failing test for a small feature, implement the minimal production code to pass it, and then refactor. This enforces TDD discipline by driving tests before code implementation.

When should I use test-driven development for refactoring existing code?

You should use test-driven development for refactoring existing code, bug fixes, and behavior changes to catch regressions early. It guides developers through writing minimal, purposeful tests that improve code quality before production code changes.

Does test-driven development work for behavior changes and bug fixes?

Yes, test-driven development works for behavior changes and bug fixes by enforcing the iron law of writing a failing test first. It ensures software correctness by requiring minimal, focused tests to validate behavior before implementing fixes.

What are the limitations of test-driven development for software quality?

Test-driven development requires writing minimal, focused tests and clean implementation, which can slow initial development speed. However, it improves overall software quality by enforcing the red-green-refactor cycle and catching regressions early in the development process.