Jump to content
  • Advertisement
  • entries
  • comments
  • views

It's not all peaches and cream

Sign in to follow this  
Mike Bossy


Looking back at some of my previous entries it might come across that everything has gone super smoothly this time around on my current project. And while a lot has, thanks to learning from previously failed projects, it hasn't all been smooth sailing.

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.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!