mattpocock / skills
tdd
Red-green-refactor workflow for building features and fixes one slice at a time.
Install
npx skills add https://github.com/mattpocock/skills --skill tddGood and Bad Tests
Good Tests
Integration-style: Test through real interfaces, not mocks of internal parts.
Characteristics:
- Tests behavior users/callers care about
- Uses public API only
- Survives internal refactors
- Describes WHAT, not HOW
- One logical assertion per test
Bad Tests
Implementation-detail tests: Coupled to internal structure.
Red flags:
- Mocking internal collaborators
- Testing private methods
- Asserting on call counts/order
- Test breaks when refactoring without behavior change
- Test name describes HOW not WHAT
- Verifying through external means instead of interface
Tautological tests: Expected value restates the implementation, so the test passes by construction.