# from Ovid
# on Tuesday 01 January 2008 00:12:

>> Either way, it is glaringly bad code.
>>
>>   a.  any call to slurp() doesn't pass a filename -- screams of evil
>>   b.  2-arg form of open -- banned
>>   c.  non-lexical filehandles -- banned
>
>This is the sort of stuff that tests are designed to catch, but stuff
>this bad *might* get missed with tight process boundaries.
>... 
>(such as the time someone was parsing 
> Data::Dumper output without considering that I may have set
> $Data::Dumper::Indent to a different value than the default).

What are the chances that tests aggregated in this way will *actually* 
catch the $D::D::Indent issue?  The bad assumptions might still work, 
right?

>> Perhaps you're trying to address the "code makes global state
>> assumptions" issue?  Well, I think that might be borrowing trouble.
>
>I'm not directly trying to address it, but it's a side-benefit and my
>real-world experience (as opposed to just sitting back and thinking
>about it), tells me that I gain more than I lose.

Yeah, you caught me thinking again.  Too much is left to accident (of 
both order and omission.)  You *might* find some of these sorts of 
bugs, but you'll be looking at them through the same puzzling lens 
(i.e. "what the? ... makes no sense!") and scratching your head just as 
much as you would if they were to manifest in a normal test.

If your mission is to speed up the tests, lumping them all into one file 
and running that accomplishes this -- but at the cost of any 
distributed or parallel options.  And there is a side-effect (whether 
or not you claim it as a benefit.)

If your mission is to un-wtf the code, a tool that parses it (and finds 
non-local()'d globals as lvalues, distant lexicals, etc) has the 
ability to point you directly at the offending code.

I bet concatenating all of the tests in the CPAN together would find 
some issues, but at the cost of how many false positives?  And, how 
many would it miss?

>> How could one test variations on that singleton's
>> parameters with T::A?
>
>Read the docs.  I explicitly address this issue.

Uh... "Be careful"?  So, how does one actually deal with it?

--Eric
-- 
Chicken farmer's observation:  Clunk is the past tense of cluck.
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------

Reply via email to