Understand TDD by asking one simple question

You know what TDD is and why you want to do it… but how do you actually do it? That part still escapes you. Red-Green-Refactor, yeah yeah yeah, you’ve heard it a million times before… but that still doesn’t help you with the HOW.

Believe it or not, understanding TDD is as simple as asking one simple question: “Does the software… X?”

Does the software…

Every single test you write is actually a question: does the software…X? And the answer to that question is whether or not the test passes.

How do you do TDD? You ask a question, that you know the answer to. You ask a question, where the answer is no. And then you change the software until the answer is yes. Then you ask your next question.

Try not to think about TDD in terms of testing (even though it has “test” in the name, and you write lots of tests!).

Think of it as if you were telling someone about a program you’re working on, and they started asking you questions: “Does the software…X?”

Getting started with TDD is really simple. Just ask a question. Turn your question into a test. Change the answer. Then, ask another question.

If you thought THAT was valuable, I've got more where that came from.

Sign up for my mailing list to make sure you never miss out.