We had a good one like that a while back. Essentially the code was like this (used to check client ID numbers)

sub is_integer { return 0 unless $_[0]; return $_[0] =~ m/^\d$/ ? 1 : 0; }

In development this routine was never required to deal with a TWO digit integer as all the developers used accounts with a <10 client ID number. Oh and the Test code.....the guy that wrote it tested all these args: undef,'', 'I am not an integer 42!', 0,1,2,3,4,5,6,7,8,9. Why ten tests for single digit integers and no tests for 16, 256,65535 GOK. Just goes to show that the volume of test is not the most important thing. Testing all the possible cases is. Even most of the probable cases would have been fine in this case.

So you can guess what happens. During a live demo client 10 gets created, but client ID 10 is not an integer according to the sub. End of that demo. Much egg on developer and manager faces. And the bug (besides the inadequate test suite) a single missing +

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print


In reply to Re: Re: Dependencies, or, How Common is Regexp::Common? by tachyon
in thread Dependencies, or, How Common is Regexp::Common? by legLess

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.