The idea that you can unit test all possible inputs and all the possible permutations of their internal interactions, and that this is enough to ensure proper type usage, is just naive.

No! I'm not.

I'm saying that if the input types to an algorithm are both type-checked & range-checked, then the ranges and types of the outputs will be consistant. There is no need to re-check those derived types and ranges. There is no need to check all possible permutations, only the boundary conditions--and thats a given.

A challenge: Demonstrate otherwise?

It makes the assumption that the design will be frozen and especially in a language like Perl where a simple bit of anti-social code like *{BrowserUK::ClassFullOfAwesome::tested_method} = sub { ... } is possible, that is a bad assumption.

You are suggesting that you need to protect against the possibility that someone will make modifications to production code to override methods at runtime. Why? So that you can tell them what they did wrong.

I guess our undestanding of what constitutes "production code" varies.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP PCW It is as I've been saying!(Audio until 20090817)

In reply to Re^10: OO automatic accessor generation by BrowserUk
in thread OO automatic accessor generation by Neighbour

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.