develooper Front page | perl.qa | Postings from March 2009

Re: Counting tests

Thread Previous | Thread Next
From:
Adrian Howard
Date:
March 18, 2009 02:54
Subject:
Re: Counting tests
Message ID:
6BDC6803-95B2-4264-8755-A4DC043B11B2@quietstars.com

On 16 Mar 2009, at 23:52, Fergal Daly wrote:

> 2009/3/16 Michael G Schwern <schwern@pobox.com>:
>>
[snip]
>> I hear where you're coming from, but there is some value in knowing  
>> a test
>> still does what it did before.  A regression test.
>>
>> Consider the following:
>>
>>   my @things = $obj->things(3);
>>   for my $thing (@things) {
>>       is $thing, 42;
>>   }
>>
>> It's nice to know that things() still returns 3 items.  Yes, there  
>> should be a
>> test in there checking that @things == 3 but maybe there's not and  
>> this is a
>> simple example.
>
> This is exactly what a plan will catch and why it can't be automated.
> As far as I can tell we're agreeing.


I don't think anybody is disagreeing here. Plans have advantages and  
disadvantages. So do no-plans. The only folk I'll disagree with are  
folk who say one or the other is universally better.

For my particular style of testing (mostly TDD, tending to write small  
isolated tests, etc.) plans tend to get in my way much more than they  
help. So I don't use them. Thank you TAP & T::B for letting me do  
that :-)

Cheers,

Adrian


-- 
delicious.com/adrianh - twitter.com/adrianh - adrianh@quietstars.com




Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About