June 23, 2008

Introducing Unit Tests (aka The Joy of Tweets)

You know, this is one of the reasons I like Twitter. If you follow people who interest you, you'll find out interesting things and possibly see some good ideas.

In particular, Jeff Atwood was tweeting about unit testing a linked to this old blog post of his. In it, he complains about excessive religious fervor from the TDD crowd, and suggests it's more important that people get used to using unit tests than that they get used to writing them before the code. Honestly, I agree and not just because I'm not used to unit tests.

I say this because he then goes on to make 2 great suggestions. First, that unit tests are important enough that they should be first class language constructs instead of being implemented the way they are now, with 3rd party libraries and external executables. Second, though quoting someone else (the link's dead though, now), that a great - if not the best - way to get people used to writing unit tests is to write a test whenever you'd think about using print or debugger code.

It may be an old post, but it's one I didn't know about and one I wouldn't have found without Twitter. Now, if only we could magically make it more scalable.