Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I've read a lot on this and other sites about testing, but I seem to be missing something fundamental between "it's a good idea" and "here's how to go about it in a real project." I've watched screencasts and presentations, I've read articles and module instructions, and the examples are always abstracted so far from my use case that I don't understand how to get from here to there.

I have a number of projects where I'm interested in automatic testing, but I'll focus on one for this posting. The code base is a set of monitoring and maintenance routines for a Windows server product. It's about 9,000 lines of code that does a lot of direct SQL work, Windows event viewer work, Windows services work, and file system work... then it records statistics in RRD files and generates some HTML and email reports. This is a free tool which is nominally open source, although I am the sole developer. The target environments run the tool as a compiled .exe, so they won't be running the test harness at all (e.g. as done during CPAN install).

In a perfect world, it would have little to say. Some of its test conditions only occur rarely, and others that I intend to add are "once-in-a-blue-moon" situations... but indicative of the kind of extreme problem that needs to be jumped on right now.

So, my question: is the idea in testing this sort of real-world application to fabricate a complete set of environmental inputs and then test the program's reactions to them? Or is there a higher level of abstraction that I'm missing? Given the number of interfaces being discussed, I've got some workload concerns with building and resetting a test case for every possible situation. How do other Perl developers do this?

In reply to how to begin with testing? by stinkingpig

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others having an uproarious good time at the Monastery: (4)
    As of 2018-01-21 01:18 GMT
    Find Nodes?
      Voting Booth?
      How did you see in the new year?

      Results (227 votes). Check out past polls.