views:

131

answers:

2

Let's say you have a Java-based product out in the market. This old code needs to be maintained, i.e. bug fixes and small feature updates.

What (open-source?) tools to you use to maintain old code?

  • To track whether a patch has been applied to all relevant branches, including the main/trunk/head?
  • To track which versions contain the fix (1.0.7, 2.2.7, ...)?
  • To review the (often critical) code changes?
+1  A: 

Do you have this code in source control? This is the most important thing and seems to satisfy your requirements. There are many open source tools to choose from - check out subversion or git. Learning how to use your source control tool will help track patches, view version history, compare two versions, etc. There are also bug-tracking tools like Bugzilla. Check out some of the Stack Overflow questions, such as version control, source control, or bug tracking.

Using these (or similar) tools are extremely important, not just for maintaining old code, but for new code as well. If you don't use source control and bug tracking now, this would be a good time to start. You can also check out Joel's article on the importance of bug tracking.

You may also want to look into unit testing and continuous integration tools to ensure that changes don't break existing functionality.

Tai Squared
A: 

On top of the version control, I would also recommend a good IDE and code clean-up tool. This will save you a bunch of frustration especial with legacy code where lots of people have put in their own style over time.

Using Eclipse you should be able to choose Source : Cleanup and have a LOT of bad formatting washed away.

I would recommend you check in the pre-cleaned code to version control just in case. Then run the code clean-up and verify that whatever test you have still work. Then check in the cleaned code and you'll save yourself a lot of cursing later.

Note that the code clean-up and formatting tools in Eclipse are very customisable. So if you prefer your {} in a certain location set that up first.

Chris Nava