Sign in to follow this  
  • entries
    162
  • comments
    262
  • views
    167035

Much Tinkering

Sign in to follow this  
OrangyTang

89 views

As mentioned previously, I need to expand some of my preprocessing tools so I can support distortion-style texture processing. The tools (and, in fact, a good portion of my library code) come from an obscure library on sourcefourge - basically one person's common code which they stored there. Theres about 20% which is really useful, about 10% which is interesting but not how I like to do things, and the rest I just tend to ignore.

A few months ago I finally decided to fork off, because the useful bits were really good, but the rest was dragging it down and stagnating. While I could change code before the fork, I always kept the changes simple and small because I wanted to keep everything backwardly compatible (espeically the command-line, preprocessing tools). The last few days are the first time I've really attacked it and made big, non-backwards compatible changes. Mostly cutting out the cruft which I think is unnessessary, but also lots of refactoring to make it easier to change and grow.

Since the code is (mostly) alien to me, and since I want the behaviour I use to remain fixed, I've wheeled out our reliable friend - unit tests.



I really should have done this a while ago. It's only a small collection of tests - some to nail down existing behaviour, some used to drive new behaviour - but it's nice to once again have a collection of tests to run which says "everything ok" after a particularly big series of refactorings.

JUnit intergration in Eclipse is rather nice - minimal, seemless, and lets you easily step in with the debugger when things go wrong. I expect I'll have a few more tests added while I get the new behaviour in, and leave it at that for now. But any further development in this library is going to be test driven - I expect that list is going to get much bigger in time. [grin]

As an aside, does anyone else find that refactoring a big, icky piece of code is quite relaxing? Watching a nice and tidy collection of code emerge out of a horrible mess is quite facinating - especially as the end result is often better than if you'd explicitly designed it up front.
Sign in to follow this  


0 Comments


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