Three Index Cards To Easily Remember The Essence Of Test-Driven Development
As I was reading a couple of ObjectMentor’s blog posts, one of them caught my attention. It was Tim Ottinger’s post on “TDD on Three Index Cards“. He recalls how someone missed part of a class he was teaching on TDD and told that individual the fundamental essence of TDD on three index cards in less than 15 minutes. After reading that, I got myself thinking “Hhhmm…not a bad idea! I wonder if it’s physically possible?“.
Ten minutes later, I’m at Staples buying some index cards and a couple of markers (for pictures purposes…of course…). Here’s the final product which every credit goes to Tim for this very simple, practical and useful idea. Kudos to my wife for taking the pictures.
Here’s a recap of the main ideas behind TDD (full credits goes to Tim):
Card #1. Uncle Bob’s Three Laws
- Write no production code except to pass a failing test.
- Write only enough of a test to demonstrate a failure.
- Write only enough production code to pass the test.
Card #2: FIRST Principles
- Fast: Mind-numbingly fast, as in hundreds or thousands per second.
- Isolated: The test isolates a fault clearly.
- Repeatable: I can run it repeatedly and it will pass or fail the same way each time.
- Self-verifying: The Test is unambiguously pass-fail.
- Timely: Produced in lockstep with tiny code changes.

Card #3: Core of TDD
- Red: test fails
- Green: test passes
- Refactor: clean code and tests

Similar posts you might be interested in reading:
- What Test-Driven Development Has Taught Me So Far
- Agile Estimation, Scrum and Poker Planning
- This Week’s Geek Links (Feb. 15th, 2008)
- Mapping a shortcut to execute unit test in current context with ReSharper
- The road towards MCPD-EAD: I passed exam 70-529
- DimeCasts.NET: 10-minutes (or less) video tutorials for developers
- This Week’s Geek Links (May 16th, 2008)






Tim:
I wish I’d posted the cards. Ah, there is not always a camera around when I need one.
You should see mine on Scrumming on two cards.
March 19, 2008, 5:50 pmBrian Di Croce:
Tim,
March 19, 2008, 6:18 pmHa! Don’t tell me one of the cards shows a pig and a chicken having breakfast at some bar!
DO:
If Dijkstra was looking over Uncle Bob’s shoulders he might tell him to add Card #0 for proof driven development, to prove the solution to yourself before implementing said solution with TDD.
March 20, 2008, 1:41 amTDD en trois fiches - 6502.fr:
[...] Di Croce a résumé le TDD en trois fiches dont voici la [...]
[WORDPRESS HASHCASH] The comment’s server IP (91.121.205.87) doesn’t match the comment’s URL host IP (87.98.138.142) and so is spam.
August 24, 2008, 9:50 amTim Ottinger:
I am now creating a whole deck of agile flash cards in the same vein. I am working with successful author Jeff Langr (Agile Java, et al) who was also a contributor with me in Clean Code. We’re working publically at http://agileinaflash.com/ in case you want to come help us with comments and criticisms.
February 26, 2009, 4:07 pm