test-driven-development

Guide writing a failing test before implementing code to pass it.

Updated Mar 31, 2024
One-click install
npx skills add https://github.com/dwb/hm --skill test-driven-development-dwb
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/dwb/hm/tree/main/conf/claude/skills/tdd
Command: npx skills add https://github.com/dwb/hm --skill test-driven-development-dwb

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps ensure code quality and correctness by enforcing a test-driven development workflow, preventing bugs and providing clear specifications.

Core Features & Use Cases

  • Failing Test First: Guides the process of writing a test that fails before any implementation code is written.
  • Iterative Development: Supports the cycle of writing a failing test, implementing just enough code to pass, and then refactoring.
  • Use Case: When developing a new feature, use this Skill to write a test that defines the expected behavior, ensuring the feature works as intended before it's fully built.

Quick Start

Use the test-driven-development skill to write a failing test for the new user authentication feature.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I start writing failing tests first for test-driven development?▼

Test-driven development prevents bugs and provides executable specifications by enforcing a test-first workflow. You write a failing test that defines expected behavior, ensuring the feature works as intended before it is fully built.

How does the iterative development cycle work in TDD?▼

The iterative development cycle in TDD involves writing a failing test, implementing just enough code to pass it, and then refactoring. This cycle repeats to maintain code quality and deliver clear specifications throughout development.

When should I use TDD to improve code quality during agile development?▼

You should use TDD during agile development when building a new feature to ensure verifiable code correctness. It provides clear specifications by defining the expected behavior through a failing test before the feature is fully implemented.

What's the best way to define expected behavior before implementing a new feature?▼

The best way to define expected behavior before implementing a new feature is to write a failing test that specifies the intended functionality. This test-first approach acts as an executable specification to guide and verify your implementation code.