tdd

Guide test-driven development with behavior-focused integration tests.

25|5|Updated Apr 22, 2017
One-click install
npx skills add https://github.com/assofohdz/subspace-infinity --skill tdd-assofohdz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/assofohdz/subspace-infinity/tree/main/.agents/skills/tdd
Command: npx skills add https://github.com/assofohdz/subspace-infinity --skill tdd-assofohdz

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates the risk of writing fragile, implementation-coupled tests that break during code refactors, and avoids the inefficiency of horizontal TDD slicing that produces tests verifying imagined behavior instead of actual user-facing functionality.

Core Features & Use Cases

  • Behavior-Focused Test Guidance: Enforces writing integration-style tests that verify public API behavior, ensuring tests remain valid even when internal code structure changes.
  • Anti-Pattern Avoidance: Explicitly warns against common TDD mistakes like horizontal slicing and implementation-detail testing, guiding users to use efficient vertical tracer bullet cycles.
  • Use Case: A software engineer adding a new ship combat system to the Subspace Infinity game can use this Skill to write a single test for the damage calculation behavior first, implement minimal code to pass the test, then refactor the combat logic without breaking existing test coverage.

Quick Start

Use the tdd skill to implement the new zone matchmaking feature by writing one passing test for the player pairing behavior before writing any implementation code.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I write integration tests that don't break during refactoring?

To write integration tests that survive refactoring, focus on verifying public API behavior rather than internal implementation details. This behavior-focused approach ensures your tests remain valid even when the underlying code structure changes.

What is the best way to apply test-driven development for feature development?

The best way to apply test-driven development for features is using vertical tracer bullet cycles. This method avoids horizontal slicing anti-patterns by writing a single behavior-focused test first, implementing minimal code, then refactoring.

Why do my unit tests fail when I refactor code?

Unit tests often fail during refactoring because they are coupled to implementation details. By prioritizing behavior-focused integration tests over implementation-detail tests, you ensure tests verify actual user-facing functionality instead of imagined behavior.

How do I avoid horizontal slicing when doing test-driven development?

To avoid horizontal slicing in test-driven development, implement efficient vertical tracer bullet cycles. This approach prevents writing tests that verify imagined behavior, instead guiding you to test actual user-facing functionality through the red-green-refactor cycle.

Can I use behavior-focused testing for bug fixes and refactoring?

Yes, you can use behavior-focused testing for bug fixes and refactoring. This test-driven development workflow ensures maintainable test coverage by designing test interfaces that verify public API behavior, keeping tests valid across internal code changes.