defect-first-testing

Installation
SKILL.md

Defect-First Testing

Agents write tests that exercise APIs but catch zero bugs. They start from "what does this function do?" and produce tests that mirror the implementation. This skill reverses the workflow — start from "what bugs could exist in this code?" and write tests that would detect those bugs.

When to use: Writing tests for any function or module. Generating test files. Adding test coverage. Reviewing whether existing tests actually catch bugs.

When not to use: Writing implementation code. Measuring coverage metrics. Testing trivial getters/setters with no logic.

Rationalizations (Do Not Skip)

Rationalization Why It's Wrong Required Action
"I'll test the happy path first" Happy-path tests catch zero bugs — the happy path already works Start from fault surface, test defect scenarios first
"100% coverage means thorough testing" Coverage counts lines executed, not bugs caught Check that each test targets a specific defect class
"The function signature tells me what to test" Signatures describe contracts, not failure modes Analyze the implementation for fault-prone patterns
"I'll add edge cases later" "Later" never comes — and agents don't revisit Identify edge cases up front via fault surface analysis

Related skills
Installs
4
GitHub Stars
5
First Seen
Mar 6, 2026