test-driven-development

Enforce test-first workflows using the RED-GREEN-REFACTOR cycle.

2|Updated Nov 21, 2025
One-click install
npx skills add https://github.com/maxjuniorbr/segflow-crm --skill test-driven-development-maxjuniorbr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/maxjuniorbr/segflow-crm/tree/main/.cursor/skills/test-driven-development
Command: npx skills add https://github.com/maxjuniorbr/segflow-crm --skill test-driven-development-maxjuniorbr

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Fornece diretrizes para desenvolvimento guiado por testes (TDD). Use ao iniciar a implementação de qualquer nova funcionalidade ou correção de bug, garantindo a escrita dos testes antes do código.

Core Features & Use Cases

  • Orientação prática para aplicar TDD do RED ao GREEN ao REFACTOR, com ciclos curtos de feedback.
  • Recomenda regras de comportamento: escrever testes antes do código, garantir que o teste falhe, e implementar o mínimo necessário para passar.
  • Use Cases incluem novas funcionalidades, correções de bugs, e refatoração segura com cobertura de testes.

Quick Start

Escreva um teste que falha para o novo comportamento antes de implementar a funcionalidade.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How does the red-green-refactor cycle work in test-driven development?

Test-driven development requires writing a failing test for new behavior before implementing any production code. This ensures tests drive the implementation and maintain proper coverage from the start.

How do I start writing unit tests before coding a new feature?

To start writing unit tests before coding, write a test that fails for the desired new behavior. Implement only the minimum production code necessary to make that test pass, ensuring tests drive the feature implementation.

Can I use test-first workflows when refactoring existing code?

Yes, test-first workflows are useful for safe refactoring. By writing failing tests before modifying code, you ensure proper test coverage and maintain secure behavior during the refactor cycle.

What is the best way to ensure proper test coverage during bug fixes?

The best way to ensure proper test coverage during bug fixes is to write a failing test that reproduces the bug first. Then, implement the minimum code correction required to turn the failing test green.

Do I need to write a failing test before implementing production code?

Yes, you must write a failing test before implementing production code. This test-first rule guarantees that the test actually validates the new behavior and that implementation is kept to the minimum necessary.

When should I not use test-driven development for software engineering tasks?

Test-driven development may not suit exploratory programming where requirements are highly volatile. The approach strictly enforces writing failing tests before production code, which requires knowing the expected behavior upfront.