I think there is a chicken-and-egg problem in this discussion and you all are talking about different layers of tests.

When designing an API is beneficial to write demo usage code. Like the synopsis part in a CPAN module. These can be tested against proof of concepts. That's the nucleus of the project.

When adjusting the spec you need to adjust those demos, hence code and test suite grow in the process.

After those are sufficiently stable you start wiring the POCs into modules with more specific unit tests, for instanceto cover edge cases.

But the tests you wrote while designing the API are already there.

You may have decided to change the internal architecture in the middle and split the code into multiple dependend modules behind the API. Different modules will have different unit test suites.

For me it's an iterative process, but this first layer of API tests will stay quite stable while the POCs will only be kept for historical reasons.

These API tests are the first tiny eggs if you want...

Cheers Rolf
(addicted to the 𐍀𐌴𐍂𐌻 Programming Language :)
Wikisyntax for the Monastery


In reply to Re^6: What to test in a new module by LanX
in thread What to test in a new module by Bod

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.