test-driven-development

Guides Red-Green-Refactor test-driven development for Kotlin and Java codebases.

Updated Jun 13, 2026
One-click install
npx skills add https://github.com/22Teikk/22Teikk-Agent-Skills-Hub --skill test-driven-development-22teikk
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/22Teikk/22Teikk-Agent-Skills-Hub/tree/main/core/skills/test-driven-development
Command: npx skills add https://github.com/22Teikk/22Teikk-Agent-Skills-Hub --skill test-driven-development-22teikk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Code written without tests breaks silently during later changes, and bug fixes made without reproduction tests often regress. This Skill enforces a disciplined Red-Green-Refactor workflow so every new behavior and bug fix is proven by a failing test first. ## Core Features & Use Cases - Red-Green-Refactor Cycle: Write a failing test, implement the minimal code to pass it, then refactor with tests staying green. - Prove-It Pattern for Bug Fixes: Reproduce any reported bug with a failing test before attempting the fix, guaranteeing the fix actually works. - Behavioral Test Standards: Distinguishes real behavioral tests (state assertions, real Room in-memory DAO tests) from zero-coverage tests like boilerplate templates and mock tautologies. - Use Case: When implementing a new createTask repository method in an Android app, write the failing unit test first, implement the minimal logic, then refactor — and verify with ./gradlew test before shipping. ## Quick Start Ask the agent to implement the next task using test-driven development, writing a failing test before any implementation code.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I practice test-driven development in Kotlin?▼

Follow the Red-Green-Refactor cycle: write a failing test describing the expected behavior, write the minimal code to make it pass, then refactor while keeping tests green. Run tests after every refactor step to confirm nothing broke.

How do I write a reproduction test for a bug fix?▼

Use the Prove-It Pattern: write a test that demonstrates the bug and confirm it fails before touching the fix. Then implement the fix, verify the test passes, and run the full suite to check for regressions.

Should I use mocks or real implementations in unit tests?▼

Prefer real implementations first, then fakes like in-memory Room databases, then stubs, and mocks only as a last resort. Reserve mocks for slow, non-deterministic, or uncontrollable dependencies such as external network APIs.

What counts as a behavioral test versus zero coverage?▼

A behavioral test executes real logic and asserts on a value or observable outcome. Boilerplate template tests, mock-verification tautologies, and assertion-less label checks count as zero coverage because they pass even when the real implementation is broken.

When should I not use test-driven development?▼

Skip TDD for pure configuration changes, documentation updates, and static resources like images or drawables that have no behavioral impact. Everything else, including bug fixes and edge case handling, should start with a test.