tdd-bug-fix

Guide test-driven development for bug fixes with unit tests and regression prevention.

1|Updated Sep 9, 2020
One-click install
npx skills add https://github.com/vgsantoniazzi/dotfiles --skill tdd-bug-fix-vgsantoniazzi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-bug-fix
Source: https://github.com/vgsantoniazzi/dotfiles/tree/main/.claude/skills/tdd-bug-fix
Command: npx skills add https://github.com/vgsantoniazzi/dotfiles --skill tdd-bug-fix-vgsantoniazzi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps developers verify bug fixes by guiding them through a test-driven development process, ensuring correctness before deployment.

Core Features & Use Cases

  • Reproduce bugs with tests to confirm issues exist.
  • Verify red by running the failing test to match the bug report.
  • Implement minimal code fixes to resolve the bug.
  • Verify green by executing tests to confirm the fix, preventing regressions.
  • Use case: A developer encounters a concurrency bug in payment processing and employs this workflow to write a test demonstrating the issue, then fixes the code and confirms the bug is resolved.

Quick Start

Describe the process of writing a test that reproduces a bug, running the test, fixing the code, and confirming the fix with a passing test.

Frequently Asked Questions about tdd-bug-fix

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

FAQPage Schema
How do I fix a bug using test-driven development?

To fix a bug using test-driven development, you write a unit test reproducing the issue, verify the test fails, implement minimal code changes to resolve the bug, and execute the tests to confirm the fix prevents regressions.

Why should I write a failing test before fixing code?

Writing a failing test before fixing code confirms the bug exists and matches the report. This test-driven approach ensures your subsequent minimal code changes are validated, preventing future regressions during the software lifecycle.

What is the best way to prevent regressions when resolving software bugs?

The best way to prevent regressions when resolving software bugs is developing a test-driven workflow. You reproduce the bug with a test, fix the code, and verify the tests pass to ensure reliable validation before deployment.

Can I use test-driven bug fixing for concurrency issues in payment processing?

Yes, test-driven bug fixing works for concurrency issues in payment processing. You write a test demonstrating the concurrency flaw, implement minimal code changes to resolve it, and verify the passing test confirms the bug is fixed.

Does test-driven bug fixing require comprehensive validation for every minor code change?

Yes, test-driven bug fixing requires comprehensive validation for every minor code change. Executing unit tests after minimal modifications ensures the bug is resolved correctly, maintaining software quality and preventing regressions before deployment.