test-driven-development

Enforce test-first development through the Red-Green-Refactor loop.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tests-first development reduces defects by requiring a failing test before code and guiding design decisions.

Core Features & Use Cases

  • Red-Green-Refactor loop: write a failing test, implement minimal code to pass, then refactor.
  • Prevents regressions by validating behavior through automated tests.
  • Use cases include new features, bug fixes, and significant refactors.

Quick Start

Write a failing test for the desired behavior, then implement just enough code to make the test pass and refactor.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How does test-driven development reduce software defects?

Test-driven development reduces defects by requiring a failing test before production code, enforcing minimal implementation to pass tests, and validating behavior through automated tests to prevent regressions.

What is the Red-Green-Refactor loop in test-first development?

The Red-Green-Refactor loop in test-driven development involves writing a failing test, implementing minimal code to make it pass, and then refactoring the code to improve design while maintaining regression safety.

When should I use test-driven development for bug fixes and refactoring?

Use test-driven development for bug fixes and refactoring to validate behavior through automated tests, prevent regressions, and guide reliable design decisions in software teams.

How do I start writing tests first for a new feature?

To start test-first development, write a failing test for the desired behavior, implement just enough production code to make it pass, and then refactor.

Does test-driven development require writing tests before any production code?

Yes, test-driven development requires writing a failing test before any production code is implemented, ensuring minimal code is written to pass the test and catch defects early.

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

Test-driven development is primarily applicable to feature development, bug fixes, and significant refactors, which may limit its use for exploratory programming or rapid prototyping where behavior is not yet defined.