Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Nice in theory. Sucks in practice. More than one developer here (on a "must never fail on pain of death" project) has skipped running the entire 1.5 hour test suite because "their one little change" won't break things and their one little test didn't break. When you're in a hurry, one and one half hours can seem like a long time :)

I see your point. We have institued a "must run tests under pain of death before commiting to CVS" policy, but even that can be subverted by modifying the working directory. We have several distinct sub-systems which do not interact with one another (except in maybe in application code that uses the sub-systems), I suppose I could use the prove utility that comes with Test::Harness (my other new favorite toy along with Devel::Cover), to script sub-system tests in some way.

Redundant tests are bad. They slow things down, they are more tests to maintain and they provide no benefit. You don't need to prove that 2+2 == 4 more than once.

Agreed, but what about if they are redundant because they are in a function? Here is an example:

sub test_Base_Interface { my ($o) = @_; can_ok($o, 'new'); can_ok($o, 'helloWorld'); } sub test_DerivedFromBase_Interface { my ($o) = @_; can_ok($o, 'new'); can_ok($o, 'gutenTag'); test_Base_Interface($o); }
The can_ok($o, 'new') test is repeated (because 'new' is overridden in 'DerivedFromBase'). Its redundant, but "for a reason" (maybe not a good one). Is this still bad? Or am I being silly and should just use Test::Class or something similar?

-stvn

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

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!
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            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?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others having an uproarious good time at the Monastery: (6)
    As of 2014-11-28 12:41 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My preferred Perl binaries come from:














      Results (196 votes), past polls