Write your tests first


Jeremy J at 37signals says when writing computer code, he writes the tests first. Then he knows that the code he writes will have to pass the tests. He says it wastes less effort and keeps him happier and more productive.

I sometimes do the same thing when trouble shooting. I write down what I’m looking for and what should happen. Then check it off. If I don’t find the problem at least I know what not to try again. And the list of failed tests helps me narrow in on what the cause of the problem is.

I’ve never done it when trying a new project, but I suppose it could work. Next time someone comes up with an idea you’d like to try, do this: before you roll it out, design the tests. That means specifiy what you expect to change, by when and how you’ll measure it. Define what measurements will constitute success, and failure. Then see what happens.

,

Leave a Reply