I think it really depends on what the module does. The objective of your test suite should be that you can safely modify code and know if the changes you have made affect existing functionality. Exactly how you reach that goal from a test point of view really depends on the functionality. Some things you want to have a whole load of micro tests for each little possible changes. Tests like these if they are well coupled to the functionality make working out what went wrong easier. OTOH having a bunch of coarse tests that WILL fail if things change will give you sufficient warning of a mistake to make enhancements a lot easier, without necessarily requiring the precision of the microtests.

In Data::Dump::Streamer I use a small number of fine grain tests for simple things with the rest tested via doing stright string comparisons of the output. Even a single one of the coarse grained tests represents a whole whack of fine grained tests.

---
demerphq


In reply to Re: Testing at the right granularity by demerphq
in thread Testing at the right granularity by polettix

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.