Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re^4: Analyzing large Perl code base.

by adrianh (Chancellor)
on Apr 16, 2005 at 14:49 UTC ( #448470=note: print w/replies, xml ) Need Help??

in reply to Re^3: Analyzing large Perl code base.
in thread Analyzing large Perl code base.

Once you do that, focus on one grouping at a time, writing lots and lots and LOTS of tests. Test everything, anything ... if it moves, test it. Heck, test it even if it doesn't move. (You want to make sure it doesn't start moving!)

While I don't think this is what you're proposing - I think this could be read as "write tests for everything in the legacy code before you change anything" which, IMHO, is a bad practice. As I said here

A counter productive practice that I've seen is to go through a large piece of legacy code and add developer tests for everything. Doing this with legacy code not driven by tests will produce a test suite that is brittle in the face of change. When you get to the refactoring you're going to find that you're going to be continually throwing away a lot of the new tests so you don't get any benefit from them.

In my experience it's much more effective to build the test suite around the changes you make to the code. Add tests when you add new features. Add tests around code that you're refactoring. Add tests to demonstrate bugs. In my experience just following those three rules naturallys build a test suite around the most important code.

Replies are listed 'Best First'.
Re^5: Analyzing large Perl code base.
by dragonchild (Archbishop) on Apr 18, 2005 at 12:43 UTC
    You're absolutely correct - my post was lacking. It's been updated.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://448470]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2017-09-24 09:08 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (273 votes). Check out past polls.