Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

comment on

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

I would say that your test script should test every possible outcome where that is feasible. It should test everything that can reasonably be tested, and particular emphasis should be given to checking the things that are obviously bound to happen do in fact happen.

If you are new to writing tests, this might sound like a nit-picking waste of time. Having spent some years qa testing code written by far more talented developers than myself, I think that it's definitely worth the extra effort. Just about any code a programmer thinks is ready for testing will (appear to) work fine in most common use cases, otherwise it wouldn't have been submitted. Obviously you should still test for this, but bugs are more likely to be unearthed in corner cases, or in situations where the program isn't doing what it looks like it's doing. (If that doesn't make sense to you, start writing some rigorous test scripts and it soon will).

If you have the resources, aim to have additional test scripts written by someone other than the author and based purely on the documented interface. This not only results in a test unbiased by the implementation, but will quickly improve the quality of your documentation.

You can also look at the test scripts for some large CPAN based distributions with multiple authors (one of the web frameworks, for example), to get an idea of the scope and depth of testing that is possible.

In reply to Re: Testing in Perl by Myrddin Wyllt
in thread Testing in Perl by mrguy123

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

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?

What's my password?
Create A New User
Domain Nodelet?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2022-09-25 01:13 GMT
Find Nodes?
    Voting Booth?
    I prefer my indexes to start at:

    Results (116 votes). Check out past polls.