tdd

Guide the red-green-refactor loop for incremental test-driven development.

Updated Sep 30, 2024
One-click install
npx skills add https://github.com/phillip-hirsch/dotfiles --skill tdd-phillip-hirsch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/phillip-hirsch/dotfiles/tree/main/.agents/skills/tdd
Command: npx skills add https://github.com/phillip-hirsch/dotfiles --skill tdd-phillip-hirsch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill facilitates the implementation of the test-driven development (TDD) workflow, addressing the need for a structured approach to software development and testing.

Core Features & Use Cases

  • Test-Driven Development: Guides through the red-green-refactor loop.
  • Behavioral Testing: Ensures tests verify behavior through public interfaces.
  • Avoid Horizontal Slices: Encourages vertical slicing for more effective testing.
  • Incremental Development: Enables gradual improvement through a cycle of writing tests and minimal implementation.
  • Refactoring Guidelines: Provides best practices for safe code refactoring.

Quick Start

Run the skill to initiate a new TDD cycle and follow the prompts for planning, writing tests, and implementing features.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I implement test-driven development using the red-green-refactor loop?

Test-driven development is implemented by automating the red-green-refactor loop, guiding you to write failing tests, create minimal implementations, and safely refactor incrementally.

What is the best way to structure tests for behavioral testing through public interfaces?

Behavioral testing is structured by verifying software behavior through public interfaces, avoiding horizontal slices and encouraging vertical slicing for more effective and isolated test coverage.

How does incremental development improve software refactoring workflows?

Incremental development improves refactoring workflows by enabling gradual code improvement through a disciplined cycle of writing tests and minimal implementations before applying refactoring guidelines.

Do I need prior knowledge of software testing principles to use a TDD workflow?

Test-driven development workflows require an understanding of software testing principles and refactoring techniques to properly implement testing behaviors through public interfaces.

When should I avoid horizontal slicing in software testing?

Horizontal slicing should be avoided when implementing test-driven development; vertical slicing is encouraged to ensure tests verify behavior through public interfaces more effectively.

How do I start a new TDD cycle for incremental feature development?

To start a TDD cycle, initiate the workflow and follow the prompts for planning, writing tests, and implementing features incrementally to ensure proper behavioral verification.