This is one for the programming geeks, and particularly relevant for the Ruby geeks here. This talk is awesome:

Katrina Owen goes over a refactoring example by showing some clearly ugly code, then setting up the tests to establish what it does, and then setting up a model object to segregate the refactoring. It’s a little piece of magic.