I get asked pretty often by people who are interested in applying for a role at Pivotal, or a number of other companies known to value test-first development, “I know about this TDD thing, but how do I know that I’m doing it right?”
Of course my first piece of advice is to try to work at a company that values TDD, but that’s a chicken-and-egg problem if those companies are testing for TDD in the interview process!
This article is an attempt to summarise and categorise the advice that I generally offer to junior developers. All code examples in Ruby using RSpec syntax.
Be like Gandhi
I like to tell people, “Write the code you want to see in the world.” Like Gandhi! If he wrote code.