Going into a situation like that, you basically have two options:
  1. Try to convince your boss to give you a large chunk of time to work on writing tests instead of fixing bugs or adding features. (Good luck if you try this...)
  2. The next time you go into the code to change something, first create a test script which exercises the code you're going to be changing and, as far as possible, defines how it currently behaves. Then make your changes, update the tests to match your changes, and run them again to verify that everything else still works the way it used to. (Or, if you prefer to drink the TDD kool-aid, change the tests first, run them to see them fail, and then change the code so that the tests succeed.) If you do this each time you make a change, you'll have an ever-growing test suite which will eventually cover most, if not all, of the code.
As far as tools, I've been perfectly happy sticking with just Test::More and occasionally bringing in Test::Warn or Test::Exception where needed.

In reply to Re: Testing Perl Code by dsheroh
in thread Testing Perl Code by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.