Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
I'd be more concerned with the number of testing scenarios and your test coverage of that. Happy-day scenarios are relatively easy to cover, and most people who write tests tend to cover those with about a 90% coverage rate (in my experience). However, the place many people I've seen don't test is the rainy-day scenarios - testing your error-handling. Do you correctly fail when you should fail?

For example, I own Excel::Template which has 3600 LOC over 28 files. (This includes POD and comments.) I have about 75-90% of the standard usages tested for - I only have 61 tests. But, each one of my scenarios is tested with 4 tests and I have 15 scenarios I test for. The reason I can run just 15 scenarios is that I have looked at what the featureset is and have written tests to deal with the commonly-used features. And, most importantly, I have shown myself, through code inspection, that the features do not bleed over into one another. So, I can test each feature (for the most part) in isolation and be fairly confident things will work together.

Now, I need to add another roughly 30 scenarios - all my error cases. I currently have no way of proving that this thing will fail correctly. I also want to add further branch and conditional tests, as shown by Devel::Cover. D::C shows me that I have a 77.9% overall coverage. It also shows me where my testing coverage is worst, which shows me where additional tests will have the most impact.

. . . I'm wondering if I'm being over-cautious in testing everything, . . .

Testing can never prove the abscence of bugs - it can only prove that the pathways you have tests for will work as expected, under the conditions you're testing them. Now, if you can show that you are testing all the usages the code can reasonably expect to see when in production, you've got a minimal amount of tests. You can always test more.

Being right, does not endow the right to be rude; politeness costs nothing.
Being unknowing, is not the same as being stupid.
Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.


In reply to Re: Test/ Code Ratio by dragonchild
in thread Test/ Code Ratio by moot

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!
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            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?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others romping around the Monastery: (5)
    As of 2014-07-14 05:31 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      When choosing user names for websites, I prefer to use:








      Results (255 votes), past polls