[squeak-dev] ENH: SUnit - shuffling the order tests are executed in

Andres Valloud AVALLOUD at roadrunner.com
Fri Aug 15 00:30:35 UTC 2008


In my opinion, this is an indirect fix for improperly written tests.  
Detecting dependencies that should not be there is a good thing, but I 
think it's even better to write tests that are truly standalone.  My 
concern is that, if I were writing poor tests, as soon as I find out 
that my contributed tests make this technique useful, I will eventually 
find a way to prevent my tests being detected, and then my 
accomplishment will be to find yet another way to write tests poorly.  
In other words, I see little incentive to write my tests as well as I 
write my code because my goal is to avoid "punishment".  For this 
reason, I'd rather invest the time in training myself to write tests 
better in the first place.  Then the tests are better, and I do not need 
to spend time implementing ways to detect bad code.

But... this is only what works for me.  Your mileage may vary.

Andres.


David Pennell wrote:
> I like the ability to shuffle the test order, but I think this should be a
> preference and that you should be able to re-run the same exact test
> sequence.
> I can't give you a crisp reason, but my gut tells me that you will want a
> way to re-run the same test sequence when things go strange.
>
> -david
>
> On Thu, Aug 14, 2008 at 11:12 AM, Brent Pinkney <brent at zamail.co.za> wrote:
>
>   
>> Hi,
>>
>> I would like to propose an enhancement to SUnit:
>>
>> Currently the order in which TestCase #test... methods are executed by
>> TestSuite is fixed.
>> This can cause dependencies to creep in if
>>        a) the TestCase class uses a TestResource and
>>        b) one #test.. method alters an aspect of the TestResource that
>> another #test... assumes is invariant.
>>
>> By adding #shuffle to TestSuite >> run:, it is more likely that this
>> corruption is exposed.
>>
>> viz.
>>        TestSuite >> run: aResult
>>                self tests shuffled do:
>>                        [ :each |
>>                        self changed: each.
>>                        each run: aResult ]
>>        !
>>
>> Please comment and I will submit a fix.
>> PS. Who maintains SUnit ?
>>
>> Brent
>>
>>
>> --
>> Brent
>>
>>
>>     
>
>   
> ------------------------------------------------------------------------
>
>
>   




More information about the Squeak-dev mailing list