tdd

Implement Test-Driven Development with a red-green-refactor cycle for code quality.

2|Updated Aug 11, 2016
One-click install
npx skills add https://github.com/rlesniak/dotfiles --skill tdd-rlesniak
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/rlesniak/dotfiles/tree/main/dot_agents/skills/tdd
Command: npx skills add https://github.com/rlesniak/dotfiles --skill tdd-rlesniak

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps developers build features or fix bugs by following the Test-Driven Development (TDD) methodology, ensuring code quality and design through a red-green-refactor cycle.

Core Features & Use Cases

  • Test-First Development: Encourages writing tests before writing the actual code.
  • Red-Green-Refactor Loop: Ensures that tests pass (green) only after writing code (red) to satisfy the test, followed by refactoring.
  • Integration Tests: Facilitates writing tests that exercise real code paths through public APIs.
  • Use Case: When a developer needs to implement a new feature, they can use this Skill to define a test for the expected behavior first, and then write the necessary code to make the test pass.

Quick Start

Use the TDD skill to start a new test for a feature you want to implement, like 'User can add items to a cart'.

Frequently Asked Questions about tdd

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

FAQPage Schema
What is the red-green-refactor loop in test-driven development?

The red-green-refactor loop in test-driven development is a cycle where you write a failing test (red), implement code to make it pass (green), and then refactor to improve design. This Skill enforces that loop to ensure code quality.

How do I start implementing a new feature using test-first development?

To start test-first development, define a test for the expected behavior before writing any implementation code. This Skill helps you create that initial test, such as verifying a user can add items to a cart, and then guides the code creation.

Does this test-driven development methodology support integration testing?

Yes, this test-driven development methodology supports integration testing by facilitating the creation of tests that exercise real code paths through public APIs, ensuring components work together correctly during the development process.

Do I need prior knowledge of TDD principles to use this development methodology?

Yes, applying this test-driven development methodology requires existing knowledge of TDD principles and practices. The Skill implements the workflow but expects developers to understand test-first development concepts.

When should I use test-driven development for my software engineering tasks?

You should use test-driven development for software engineering tasks that require strict code quality and design validation. It is highly applicable when building new features or fixing bugs where defining expected behavior upfront is critical.

What is the best way to ensure code quality when fixing bugs?

The best way to ensure code quality when fixing bugs is using test-driven development to write a failing test that reproduces the bug, then writing code to pass the test. This Skill guides that red-green-refactor cycle to validate fixes.