SKILL

tdd-best-practices

Test-Driven Development guidance. Use when writing tests before implementation, applying Red-Green-Refactor, testing Value Object contracts, typed domain failures/Results, DDD Aggregates, Domain Events/subscribers, transaction or cache boundaries, data migrations/backfills, Criteria/query adapters, repository contracts or persistence adapters, choosing between test doubles, deciding test granularity, reviewing test suite quality, or diagnosing brittle tests.

Target: Software development & testing. Automatically collected · unverified.

Excerpt from the author’s documentation

Extracted from a fixed version of SKILL.md in its original language. This is the author’s documentation; installation, compatibility and runtime results have not been verified by this site.

Read the original English text

Topics in the source

  • TDD Best Practices
  • Working Style
  • The Red-Green-Refactor Cycle
  • The 3 Laws (Uncle Bob)
  • Design Workflow
  • Choosing Test Granularity
  • Heuristics
  • When to mock

Use this skill when the main question is how to drive implementation from tests, how to structure a test suite, or how to recover discipline in a codebase where tests were written after the fact. 1. Write one failing test, then make it pass with the minimum code needed. 2. Refactor only when all tests are green. 3. Test behaviors, not implementations — the public API, not private methods. 4. Keep tests as simple as the production code they verify. 5. A test suite that is hard to change is as expensive as production code that is hard to change. The discipline is in the order. Never refactor on Red. On Green, add only the behavior demanded by the current failing test. 1. You may not write production code unless you have a failing unit test. 2. You may not write more of a unit test than is sufficient to fail. An intentionally missing public API/type can be a valid first Red; unrelated compilation or setup failures are not. 3. You may not write more production code than is sufficient to make the currently failing test pass. 1. Describe the behavior — what should the system do? Write the test name first. 2. Write a failing test — make it fail for the right reason (assertion, not setup e

This is an excerpt. Refer to the complete source and its current requirements.

Source repository
OKHP3/skillz
Source file
community/tdd-best-practices/SKILL.md
Fixed revision
7b187777d42ab7bc7bab1e5f2c940cd3139ecebf
Read the complete original documentation ↗

Sources and evidence

This record was collected automatically. Its documentation, suitability and runtime behavior have not been manually verified.

Author: OKHP3/skillz · original repository metadata. Documentation review: Not reviewed. Last source check: 2026-11-10T10:00:54.376Z.

Categories are inferred from names, descriptions and paths. They do not establish compatibility.

License and attribution

MIT. Third-party content and copyright remain with their authors. Refer to the original license and terms.

Original license ↗

Synchronization, copying and user-reported success do not mark a resource as runtime-tested.

Limitations and notes

  • Collecting metadata does not mean this site has installed, adapted, runtime-tested or security-reviewed the resource.