test-driven-development

Enforce writing failing tests before implementation to prevent unverified production code.

30|2|Updated Mar 3, 2022
One-click install
npx skills add https://github.com/lie5860/ak-guess --skill test-driven-development-lie5860
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/lie5860/ak-guess/tree/main/.agents/skills/test-driven-development
Command: npx skills add https://github.com/lie5860/ak-guess --skill test-driven-development-lie5860

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Helps teams avoid shipping unverified or brittle code by enforcing a test-first workflow that surfaces missing behavior early, prevents regressions, and documents intended behavior as executable specifications.

Core Features & Use Cases

  • Red-Green-Refactor cycle: Drive design and implementation by first writing a failing test, then the minimal code to pass, then refactor with confidence.
  • Bug fixes and regression prevention: Reproduce bugs as failing tests before fixing them to ensure the defect stays fixed.
  • Refactoring safety and documentation: Use tests as living documentation that protects refactors and clarifies expected behavior.
  • Verification checklist: Emphasizes validating failing tests, minimal implementation, all-green test suites, and avoidance of testing anti-patterns.

Quick Start

Write a minimal failing test that demonstrates the desired behavior, confirm it fails for the expected reason, implement the smallest change to make it pass, and keep the test green while refactoring.

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 test-driven development for new software features?

Test-driven development begins by writing a minimal failing test that demonstrates desired behavior. You confirm the test fails for the expected reason, implement the smallest code change to pass it, and refactor while keeping the suite green.

What is the red-green-refactor cycle in unit testing?

The red-green-refactor cycle drives design by first writing a failing test, implementing the minimal code to make it pass, and then refactoring with confidence. It surfaces missing behavior early and prevents unverified production code from shipping.

How do I use test-first workflows to fix bugs and prevent regressions?

Test-first bug fixing requires reproducing the defect as a failing test before changing any code. Validating the failure ensures you fix the exact issue, and the passing test stays in the suite to prevent future regressions.

Can I use test-driven development for refactoring existing code safely?

Test-driven development protects refactoring by using tests as living documentation of expected behavior. Keeping the test suite all-green during code changes ensures structural improvements do not alter or break existing software functionality.

What testing anti-patterns should I avoid when writing tests first?

When writing tests first, avoid skipping failure validation, writing overly broad tests, or implementing more than the minimal passing change. Following a verification checklist ensures minimal focused tests and a reliable green test suite.