Leave the Last Test Broken...

Been reading Test driven Development at the moment (toghether with other 10 or so books, heh) and today i came accross this sentence that really got me. It’s one of those things you want to write on a piece of paper and stick it on your monitor so you never forget. Kent Beck says: “How do you leave a programming session when you’re programming alone? Leave the last test broken.”

Basically he is saying that one should never leave the code for the next session in a perfectly working state. Before leaving, one should always make one last thing and make sure that that last thing does not work. …so that when you come back to the code, you then have an obvious place to start - “an obvious, concrete bookmark to help you remember what you were thinking”. This will also keep you away from just staring at the code and marvelling at how everything works, trying to think of what to work on next but not really starting it yet cos you don’t want to break anything so soon ;) .. or just trying to remember the mental state you were in and thus wasting a lot of time before finally getting back to typing. (happens to me a lot of times!)

This does not work out well if you’re working with a team, though ;)