This is one version of the "What do I do with this old code?" question. Basically, you're looking at maintaining cruft and how to do that safely. Personally, I would go through the following steps:
- Document the assumptions you find. At least review the documentation. We're going through this right now with some old VB code. We have no idea what language the app will end up being in, but at least we have some idea of what's going on, in case the primary maintainer gets hit by a bus. Twiki is good for this, and easy to set up. Plus, management can read it, if they care.
- Start adding unit tests. Add tests for everything you touch, plus one additional test. The tests may start out being stupid, but at least you'll have something. Plus, you're only testing those items you change. Stuff that isn't broken and isn't being touched, theoretically, doesn't need to be looked at ... at first.
- Eventually, you'll end up with a critical mass of documentation and unit tests. At that point (3-9 months down the road), you'll be able to make better decisions about what to do with the code. You might have accidentally rewritten some of it by that time. At the very least, you'll be able to make better cases to management for whatever decision you choose to make.
Basically, you need to triage based on need for new functionality. Most applications tend to have between 50% and 90% of the code touched every 18 months, or so. This is a rule of thumb, based on my experience.
------
We are the carpenters and bricklayers of the Information Age.
Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose
I shouldn't have to say this, but any code, unless otherwise stated, is untested
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|