in another word, how do you know that you have tested enough?

new to testing, I just started writing test for the webapp i wrote, using Test::More and Test::WWW::Mechanzie (i wrote the webapp first. otherwise would be interesting to try test-first before writting code). with corner cases and bad inputs, i feel that i have tested the webapp enough ( so it works the way it should ) along with T::W::M testing, i also test module requirements, configuration file. so far it has been joyful.

however, based on what i read from here and perldoc, i seem to missing unit test. i.e test each function and module API. I think Test::Tutorial has an example on this. i also read this:

Bill Venners: When do you stop writing tests? You say in Refactoring, +"There's a point of diminishing returns with testing, and there's a d +anger that by writing too many tests you become discouraged and end u +p not writing any. You should concentrate on where the risk is." How +do you know where the risk is? Martin Fowler: Ask yourself which bits of the program would you be sca +red to change? One test I've come up with since the Refactoring book +is asking if there is any line of code that you could comment out and + the tests wouldn't fail? If so, you are either missing a test or you +'ve got an unnecessary line of code. Similarly, take any Boolean expr +ession. Could you just reverse it? What test would fail? If there's n +ot a test failing, then, you've obviously got some more tests to writ +e or some code to remove.
from http://www.artima.com/intv/testdriven4.html

It reads fine. but i got the feeling that i am going to write hella more tests if using his method. now for the experienced monks, I am interested in how much unit testing or just general testing do you do?


In reply to when do you stop writing test? by Qiang

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.