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

Colin Putney cputney at wiresong.ca
Fri Aug 15 01:00:11 UTC 2008

On 14-Aug-08, at 5:30 PM, Andres Valloud wrote:

> 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.

Yeah, the tests are improperly written. But just saying "don't do  
that" doesn't help.

I want to write the best tests I can. I *do* write the best tests I  
can. But sometimes, when the test suite is large, and when I haven't  
personally written all the tests, dependencies can creep in, despite  
my best efforts. In that case, I want the best tools possible to help  
me find and fix the problem. Shuffling the tests makes it more likely  
that I'll notice the problem. Being able to reliably repeat a  
problematic test run makes it easier to diagnose the problem.

Brent's proposal isn't about "punishing" developers who write  
"improper" tests. It's about making the problems more visible so they  
can be found and fixed more easily. Sounds good to me.


More information about the Squeak-dev mailing list