Skip to content

Instantly share code, notes, and snippets.

@evolve2k
Last active December 15, 2015 12:19
Show Gist options
  • Save evolve2k/5259568 to your computer and use it in GitHub Desktop.
Save evolve2k/5259568 to your computer and use it in GitHub Desktop.
Uncle Bob introduced the idea of TPP and in his literature referrs to a number of rules. Here I document some 'coding rules'.

Meditations

  1. You are not allowed to write any production code unless it is to make a failing unit test pass.
  2. You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures.
  3. You are not allowed to write any more production code than is sufficient to pass the one failing unit test.
  1. When passing a test, prefer higher priority transformations.
  2. When posing a test choose one that can be passed with higher priority transformations.
  3. When an implementation seems to require a low priority transformation, backtrack to see if there is a simpler test to pass
  1. Runs all the tests.
  2. Expresses every idea that we need to express.
  3. Says everything OnceAndOnlyOnce.
  4. Has no superfluous parts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment