tdd

Guide Unity C# developers through red-green-refactor loops with integration-style tests.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/fuxiang123/unity-harness --skill tdd-fuxiang123
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/fuxiang123/unity-harness/tree/main/assets/github/skills/tdd
Command: npx skills add https://github.com/fuxiang123/unity-harness --skill tdd-fuxiang123

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reduces regression risk and developer uncertainty by enforcing a test-first workflow that verifies observable behavior through public interfaces rather than implementation details.

Core Features & Use Cases

  • Red‑Green‑Refactor Loop: Guide to write one failing test, implement the minimal code to pass, then refactor safely.
  • Integration-style Tests: Prefer tests that exercise real code paths through public APIs to survive refactors.
  • Design for Testability: Advice on dependency injection, small interfaces, and deep modules to make testing natural.
  • Use Case: Implement a new checkout flow by writing a single integration test that describes the user-visible outcome, make it pass, and iterate until the feature is complete.

Quick Start

Write one failing integration test that describes a single user-visible behavior, implement the minimal code to make it pass, and repeat.

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 for Unity and C# projects?

Test-driven development for Unity and C# projects uses a red-green-refactor loop: write one failing integration test against a public interface, implement minimal code to pass, then refactor safely.

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

The red-green-refactor loop is a test-driven development cycle where you write a single failing test describing user-visible behavior, implement the minimal code to make it pass, and refactor only after tests are green.

How do I write integration-style tests that survive refactoring?

Write integration-style tests that exercise real code paths through public APIs rather than testing implementation details, ensuring your tests survive refactoring and verify observable behavior.

Does test-driven development work for fixing bugs in C#?

Test-driven development works for bug fixes in C# by writing a failing integration test that reproduces the bug against public interfaces, then implementing minimal code to pass the test.

How do I design for testability using dependency injection?

Design for testability by using dependency injection, creating small interfaces, and building deep modules to make testing natural and enforce verifying behavior through public interfaces.

When should I use tracer-bullet workflows in test-driven development?

Use tracer-bullet workflows in test-driven development when implementing new features like a checkout flow, writing a single integration test describing the user-visible outcome and iterating until complete.