Being all into agile and iterative development one of the pactices I follow is fairly heavy refactoring. Refactoring allows you to clean up your code and design in an iterative manner that just makes your work get cleaner, tighter and easier to use over time. Think of it as an ongoing revision of your design and code as you learn more about how things should work. There's nothing more fulfilling then going back to an old system and making it work even better.
The big problem with refactoring is that you're touching old code. This can lead to an introduction of not only a new found cleanliness but also new bugs. The way to solve this problem is using Test Driven Development techniques. That means creating a bunch of unit test suites for your objects so that when you do go and refactor you can easily run your unit tests to make sure everything is still running as expected. A lot of times it's hard to envision how to unit test parts of your game but it is possible to cover most of it. There was a fairly good talk at GDC this year by the High Moon guys on TDD. You can find their website devoted to this kind of thing at:
Unit testing was something that I had planned to do from the beginning but just got behind on. The excitement of writing new functionality was too much to keep me focused on unit tests. Of course this has come back to bite me in the ass. Whenever I do any refactoring of my engine or game code I end up with some stray bug which takes forever to track down. Lost time due to laziness. Yay.
I have finally started retroactively adding unit tests to my engine library. At some point in the future I plan to port my engine to Mac so the unit tests will definitely come in handy. In the mean time it's kind of boring but coding can't always be exciting. If that was the case none of our games would ever have a UI.