Loading...
Loading...
Write the test first, watch it fail, then write the least code that passes. Covers where the test belongs, what makes it honest, what a passing test proves and what it does not, recovering when code was written before the test, and starting a bug fix from a red run. A test nobody watched fail proves nothing. Use when implementing a feature or a bugfix, when a test was written after the code, when a test passes the first time you run it, or when the user says "write tests for this", "add coverage", or "TDD this". Not for judging tests inside a change under review, and not for choosing a test framework.
npx skill4agent add gabrielmoreira/skills test-first-by-evidencedebugging-by-evidenceNO PRODUCTION CODE WITHOUT A TEST YOU WATCHED FAIL| If you see... | Read |
|---|---|
| a test about to be written, or one that passed on its first run | |
| a red you trust and code to write against it | |
| no obvious place for the test, or a choice between unit, integration, and end to end | |
| mocks, fixtures, or assertions on calls rather than on results | |
| implementation that already exists with no test behind it | |
| a bug report, a stack trace, or a regression | |
| a test that is hard to write, or needs everything mocked | |
| Phase | Means | Licenses |
|---|---|---|
| nothing written yet | writing one test, nothing else |
| the test ran and failed for the stated reason | implementation |
| the test passes and so does everything else | refactoring |
| duplication and names cleaned, still green | the next test |
REDGREEN