Skip to content
Back to skills

Testing Tdd

ASecurity

Writes tests following TDD Red-Green-Refactor cycle. Language-agnostic methodology with Arrange-Act-Assert structure. Use when implementing features test-first.

  • 3 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 5, 2026
ai-agentsgobashtestingapi

Works with

  • claude code
  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned November 23, 2026

npx -y skills add qte77/claude-code-plugins --skill testing-tdd --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Testing Tdd?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Testing Tdd
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/qte77-testing-tdd/badge)](https://www.skillsdirectory.com/skills/qte77-testing-tdd)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: testing-tdd
description: Writes tests following TDD Red-Green-Refactor cycle. Language-agnostic methodology with Arrange-Act-Assert structure. Use when implementing features test-first.
compatibility: Designed for Claude Code
argument-hint: "[feature-or-module-to-test]"
metadata:
  intended-tools: Read, Grep, Glob, Edit, Write, Bash
  stability: development
---

# Test-Driven Development

**Target**: $ARGUMENTS

Writes **focused, behavior-driven tests** following the TDD Red-Green-Refactor cycle. Language-agnostic — works with any test framework (pytest, vitest, jest, cargo test, etc.).

## Quick Reference

- TDD cycle + anti-patterns: `references/tdd-best-practices.md`
- What to test/skip + mocking strategy: `references/testing-strategy.md`

## TDD Cycle

1. **RED** — Write a failing test that describes the expected behavior
2. **GREEN** — Write minimal code to make the test pass
3. **REFACTOR** — Improve code quality while tests stay green
4. Repeat

**Never skip RED.** Every feature starts with a failing test.

## Test Structure: Arrange-Act-Assert

Every test has three phases:

```text
ARRANGE — Set up test data and dependencies
ACT     — Execute the behavior under test
ASSERT  — Verify the outcome
```

## What to Test (KISS/DRY/YAGNI)

**High-Value** (test these):

- Business logic — algorithms, calculations, decision rules
- Integration points — API handling, external service interactions
- Edge cases — empty inputs, error propagation, boundary conditions
- Contracts — response formats, data transformations

**Avoid** (skip these):

- Library behavior — framework internals, third-party validation
- Trivial assertions — existence checks, type checks, default values
- Implementation details — internal state, private methods
- Styling/layout — CSS, class names

See `references/testing-strategy.md` → "Patterns to Remove" for full list.

## Decision Checklist

Before writing a test:

1. Does this test **behavior** (write it) or **implementation** (skip it)?
2. Would this catch a **real bug** (write it) or is it **trivial** (skip it)?
3. Is this testing **our code** (write it) or **a library** (skip it)?

## Mocking Strategy

- Mock external dependencies (APIs, network, filesystem)
- Mock non-deterministic values (time, random, UUIDs)
- Use real services when in-memory alternatives exist
- Constrain mocks to real interfaces (typed mocks, spec=)
- Never mock internal functions in the same module

## Quality Gates

- [ ] Every feature starts with a failing test (RED)
- [ ] Tests use Arrange-Act-Assert structure
- [ ] No tests for library internals or implementation details
- [ ] Mocks use spec/type constraints (no untyped mocks)
- [ ] Test names describe behavior, not methods
- [ ] All tests pass before committing

Files in this skill

  • SKILL.md2.8 KB
  • references/tdd-best-practices.md3.4 KB
  • references/testing-strategy.md3.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.