Hi all, I have been handed responsibility of a perl application, it has some *ok* documentation, uses CVS and seems to work as it should.

However what it is suffering from is bugs being introduced, bugs being fixed and the same bug coming back again. I have to put my hand up and admit that I have never used any of the perl testing framework previously, however always seeking to improve and stabalise the application I am sure most here will agree introducing a testing suite to the application and would like to ask others advice/experiences in patching in testing *after* an application is built.

Currently all the applications modules sit in a fixed directory sturcture, say /var/application/modules/, where all scripts/CGI's which are using the modules will simply have a use lib '/var/application/modules/', then followed by a standard use statement.

The reason why I mention this I am also new to generating the stub modules using h2xs, and anyway seems somewhat late for this but what I would like to achieve is pretty much what h2xs generates.

What I think is needed is for every 'module' there is an associated test script, which tests a modules unique methods. Of course the modules all interact with each other, so there also needs to be test scripts which test the relationships between the various modules.

Now what I believe would be the correct way forward, would be to have a single Makefile.PL which when ran would generate a Makefile which would effectively allow all the tests against all of the modules at once. For instance using h2xs, (and maybe I just dont understand it) I could create a new modules, then go into its directory do a perl Makefile.PL;make;make test, and this would run *that* modules test scripts in tthe /t/ dir. However I want to have a Makefile.PL which would do this process for *all* of the relevant modules at once, so the make test would perform all the tests. Then I believe that doing a make install (subject to the tests being completed ok) would build the modules in the standard libraries thus doing away with the use lib on the production servers.

So is above a feasible idea, how do I go about plugging in Makefile facilities after the code is written ? I have done some test scripts already, however is there any advice anyone can give a testing newbie on creating good test cases ?

And if I am doing this the wrong way guidance would be welcome


In reply to Testing a already built application by ropey

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.