test-driven-development_skill

This skill teaches test-driven development patterns across languages, accelerating reliable features, safer refactors, and clearer contracts through
  • Python

13

GitHub Stars

2

Bundled Files

2 months ago

Catalog Refreshed

4 months ago

First Indexed

Readme & install

Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.

Installation

Preview and clipboard use veilstrat where the catalogue uses aiagentskills.

npx veilstrat add skill bobmatnyc/claude-mpm-skills --skill test-driven-development

  • metadata.json654 B
  • SKILL.md9.7 KB

Overview

This skill provides a compact, language-agnostic Test-Driven Development (TDD) guide with patterns, examples, and practical rules you can apply across projects. It consolidates Red-Green-Refactor workflow, test structure, test types, mocking guidance, coverage targets, and anti-patterns to eliminate redundant testing advice. Use it to standardize test design and speed up reliable development across teams and languages.

How this skill works

The skill inspects common testing scenarios and prescribes focused actions: write a failing test (Red), implement the minimal code to pass it (Green), then clean the design while keeping tests green (Refactor). It presents concrete patterns like Arrange-Act-Assert and Given-When-Then, naming conventions, language-specific snippets, and recommendations for unit, integration, and end-to-end tests. It also guides when to mock, coverage targets, what to test or skip, and anti-patterns to avoid.

When to use it

  • Implementing a new feature to drive design via tests
  • Fixing a bug by reproducing it with a failing test first
  • Refactoring code while ensuring behavior is preserved
  • Designing APIs and contracts with testable expectations
  • Validating complex business logic or state transitions

Best practices

  • Follow Red-Green-Refactor: failing test, minimal pass, then refactor
  • Name tests descriptively: test_should_<expected>_when_<condition>
  • Prefer one focused assertion per test to isolate failures
  • Keep tests independent and deterministic; avoid shared state
  • Mock external systems for unit tests; use real integrations only in integration/E2E tests
  • Write clear failure messages and reusable test data builders

Example use cases

  • Add a payment feature: write contract tests for edge cases, then implement minimal code
  • Refactor legacy module: create unit tests first to lock behavior, then refactor safely
  • Build an API: test endpoints and response contracts before shipping
  • Fix intermittent bug: reproduce it with a focused test that fails consistently
  • Create CI pipeline: enforce coverage targets for critical paths and business logic

FAQ

Unit tests should target a single function or method and cover edge cases; mock external dependencies so tests run fast and deterministic.

When should I avoid mocking?

Avoid mocking when verifying integration behavior between components or when tests should validate real interactions in integration or end-to-end suites.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational
test-driven-development skill by bobmatnyc/claude-mpm-skills | VeilStrat