tdd-patterns

Installation
SKILL.md

Test-Driven Development Patterns

Before tactics, settle strategy: a test is an automated, isolated procedure; it is written before the code; the work is driven by a written list of tests; each test is built from its assertion backwards; and its data is chosen so a reader can see why the expected answer is right.

Test (noun)

Question: How do you test your software? Answer: Write an automated test.

  • "Testing" a change by clicking around is not the same as having a test. A test is a procedure that runs by itself and yields pass or fail.
  • Under stress, manual testing drops, errors rise, stress rises: a vicious loop. Automated tests break it: when stress rises, run the tests. Green turns fear into boredom.
  • Whenever you feel unsure whether a change broke something, run the suite instead of guessing.
  • Running a new test you are sure will fail is optional, but a surprise pass tells you something (the behavior may already exist).

Isolated Test

Question: How should running one test affect another? Answer: Not at all.

Installs
1
First Seen
1 day ago