Test-Driven Development (TDD)

Enforce Test-Driven Development with failing tests before feature implementation.

149|10|Updated Oct 30, 2025
One-click install
npx skills add https://github.com/tilework-tech/nori-profiles --skill test-driven-development-tdd-tilework-tech
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Test-Driven Development (TDD)
Source: https://github.com/tilework-tech/nori-profiles/tree/main/src/installer/features/profiles/config/_mixins/_swe/skills/test-driven-development
Command: npx skills add https://github.com/tilework-tech/nori-profiles --skill test-driven-development-tdd-tilework-tech

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill enforces a strict Test-Driven Development (TDD) workflow, ensuring that all new features and bug fixes are accompanied by robust, failing-first tests, leading to higher code quality and fewer regressions.

Core Features & Use Cases

  • Red-Green-Refactor Cycle: Guides through writing failing tests, minimal implementation, and refactoring.
  • Behavioral Testing: Emphasizes testing real behavior and integration boundaries, not just mocks or implementation details.
  • Failure Verification: Mandates verifying that tests fail correctly before writing implementation code, proving test efficacy.
  • Use Case: When implementing a new user authentication module, use this skill to guide the TDD process, ensuring each piece of functionality is tested and verified before it's considered complete.

Quick Start

I need to implement a new feature. Guide me through the Test-Driven Development process.

Frequently Asked Questions about Test-Driven Development (TDD)

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

FAQPage Schema
What is test-driven development and how does it improve code quality?

Test-driven development is a methodology where you write failing tests before implementing features, ensuring code meets requirements from the start. This approach catches bugs early, documents expected behavior, and produces more reliable, maintainable code with fewer regressions.

How do I implement the red-green-refactor cycle for a new feature?

Write a failing test that specifies the desired behavior, verify it fails for the right reason, implement minimal code to pass the test, confirm all tests pass, then refactor without changing external behavior. This cycle ensures each feature is tested and verified before completion.

How do I verify that my tests actually fail before writing implementation code?

Run your test suite before any implementation to confirm tests fail. This verification proves your tests exercise the right code path and will catch real bugs. Without this step, tests may pass for the wrong reasons and miss actual failures.

Can I use test-driven development for bug fixes as well as new features?

Yes. Write a failing test that reproduces the bug, verify it fails, apply minimal changes to fix it, then refactor if needed. This ensures the bug stays fixed and prevents regressions on the same code path.

What's the difference between unit testing and integration testing in TDD?

Unit tests verify individual functions or components in isolation, while integration tests verify real behavior across module boundaries. TDD emphasizes behavioral testing at integration boundaries to ensure features work end-to-end, not just mocks in isolation.

When should I refactor during the red-green-refactor cycle?

Refactor only after tests pass. Focus on improving code clarity, removing duplication, and simplifying logic without changing external behavior. Refactoring with a passing test suite ensures changes don't break functionality.