I've inherited an extremely large app written with CGI.pm and running under mod_perl. It's well-written, as it goes (or would have been regarded as well-written 15 years ago), but everything is lumped together; there's no separation of concerns at all. It's the intention to rewrite this using modern standards (probably Catalyst or Mojolicious), but in the meantime, there are no tests for this app and I need to get at least some basic ones going. A Mechanize script is going to be the only way of accomplishing this, because of the lack of separation.

Is there a test framework that will run this internally, so that I don't have to have a separate Apache installation just for testing (it would be politically impossible to set something like this up)? Similarly, what's the easiest way to mock a database for testing purposes? (The production DB is SQL Server.)

I'm used to the various Catalyst things that do this seamlessly and behind the scenes. I don't really care about how to accomplish this, I just want some simple way of getting started so I can start writing test scripts.


In reply to Testing large legacy CGI app 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.