Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. -- Python Philosophy

Leave the last test broken…

Posted: November 11th, 2003 | Author: klaut | Filed under: General |

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 ;)


4 Comments on “Leave the last test broken…”

  1. #1 aSH said at 9:45 pm on November 11th, 2003:

    Hehe, nice bookmark!

  2. #2 JesterXL said at 12:14 am on November 12th, 2003:

    I just compile it and can quickly find someting to work on, hehe!

  3. #3 Grant Skinner said at 7:11 pm on November 12th, 2003:

    Or, you could just write yourself a quick comment in the code… that would be a little safer than intentionally sabatoging your own work, and a whole lot clearer, IMHO.

    :/

  4. #4 Peter Elst said at 6:28 pm on November 17th, 2003:

    That’s actually a very good tip! What I usually do is simply write to-do lists and amend that throughout the project as needed.