mirror of
https://github.com/obra/superpowers.git
synced 2026-07-09 03:29:04 +08:00
feat(skills): absorb falsifiability discipline into writing-good-tests
Generalized from agentsview's testing-without-tautologies skill: a new Iron Law and lead rule (name the production change that would fail the test, derive expectations independently of the code under test), a test-your-code-not-the-framework rule with the characterization-test exception and the trivial-code guidance, branch-specific doubles folded into Mock at the Right Level, a closing Mutation Check, and six new warning-sign smells. Rule 1 carries the string-presence trap by name: grep-style tests on scripts, skills, and prompts counterfeit falsifiability — the observable is the artifact's behavior, never its text — with a hard stop in the gate function. Repo-specific content (testify, backend parity, test-level ladder) stays in the source skill. Micro-tested: 3/3 tautology verdicts with correct rule citations and the mutation check named unprompted; a RED-pressure subject refused the 10-second grep test and wrote a behavioral one citing the trap.
This commit is contained in:
@@ -204,6 +204,7 @@ Next failing test for next feature.
|
||||
| **Shows intent** | Demonstrates desired API | Obscures what code should do |
|
||||
|
||||
When writing or changing any test, read [writing-good-tests.md](writing-good-tests.md) for the rules that keep tests honest:
|
||||
- Name the production change that would make the test fail — before writing it
|
||||
- Assert on real behavior, never on mock behavior
|
||||
- Keep test-only code in test utilities, out of production classes
|
||||
- Understand a dependency's side effects before mocking it
|
||||
|
||||
Reference in New Issue
Block a user