Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I was reading Petdances log ( and he summarised testing as .....
    Never underestimate the power of one little test.
    There is no such thing as a dumb test.
    Your tests can often find problems where you're not expecting them.
    Test that everything you say happens actually does happen.
    If it's worth documenting, it's worth testing.

I asked him a few questions on his testing methodology and Andy answered back a few gems that you may find interesting ... (reproduced below).

  1. Think about what the code should do.
  2. Think about the API.
  3. Write the documentation for the code, explaining what the parms do.
  4. Write the test code that uses the API.
  5. Keep doing #3 and #4 until all the cases are covered. "Oooh, I hadn't thought of the case where a length is negative." So you type in the docs "If the length passed is negative, then a warning is thrown," and then write the test that tests that. Or vice versa.
  6. Write the code. You may go back to #3 and #4 as necessary because you think of more things as you write.
  7. Check it into CVS. Move on, knowing that you're covered.

What I get back from this is testing is soft of self discovery processing where testing allows you to enforce how your code should behave. At the same time uncover defects. Follow the links to see what modules are being used.

In reply to Re: Testaholics Anonymous (or how I learned to stop worrying and love Test::More) by g00n
in thread Testaholics Anonymous (or how I learned to stop worrying and love Test::More) by stvn

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 the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others meditating upon the Monastery: (10)
    As of 2021-04-21 14:29 GMT
    Find Nodes?
      Voting Booth?

      No recent polls found