Re: [Pharo-project] About reusing tests via traits

2008-10-07 Thread Alexandre Bergel
I agree with your Bill. No strong empirical study have been made that demonstrate the benefit of traits over traditional class inheritance. What? Have a look at Nile and the refactoring of the collection hierarchy made by nathanael. However, this is hard to achieve, and we do not have res

Re: [Pharo-project] About reusing tests via traits

2008-10-07 Thread Stéphane Ducasse
On Oct 6, 2008, at 5:45 PM, Bill Schwab wrote: Alexandre, Any performance hit aside, I am willing to go along. However, the direction of the crowd generally makes me suspicious vs. reassuring me that something is correct. Granted, this isn't the Visual this-that-or-the-other-thing.CloudyNET

Re: [Pharo-project] About reusing tests via traits

2008-10-07 Thread Stéphane Ducasse
On Oct 6, 2008, at 5:19 PM, Alexandre Bergel wrote: I agree with your Bill. No strong empirical study have been made that demonstrate the benefit of traits over traditional class inheritance. What? Have a look at Nile and the refactoring of the collection hierarchy made by nathanael. H

Re: [Pharo-project] About reusing tests via traits

2008-10-07 Thread Stéphane Ducasse
I wonder what the advantages of using Traits over creating a test class hierarchy mirroring the collection hierarchy is? When you change a test you have to go to all your hierarchy. Traits do that for you for free. Normally the tests in TEmptyTests should be valid on all collections and should

Re: [Pharo-project] About reusing tests via traits

2008-10-06 Thread Adrian Lienhard
Bill, On Oct 6, 2008, at 17:45 , Bill Schwab wrote: Alexandre, Any performance hit aside, I am willing to go along. However, the direction of the crowd generally makes me suspicious vs. reassuring me that something is correct. Granted, this isn't the Visual this-that-or-the-other-thing.Cloud

Re: [Pharo-project] About reusing tests via traits

2008-10-06 Thread Bill Schwab
Alexandre, Any performance hit aside, I am willing to go along. However, the direction of the crowd generally makes me suspicious vs. reassuring me that something is correct. Granted, this isn't the Visual this-that-or-the-other-thing.CloudyNET marketing group telling us what they think we shoul

Re: [Pharo-project] About reusing tests via traits

2008-10-06 Thread Alexandre Bergel
I agree with your Bill. No strong empirical study have been made that demonstrate the benefit of traits over traditional class inheritance. However, this is hard to achieve, and we do not have resource to conduct such experiment. We are therefore left to our intuition that using traits is bet

Re: [Pharo-project] About reusing tests via traits

2008-10-06 Thread Lukas Renggli
> represent a bloc of coherent behavior that can be parametrized. Load the > latest Collection-Tests from the > pharo source. This is just the start but this is quite cool. Check > TEmptyTest. It is applied to > OrderedCollection, Basg, Set, Array, Interval (and could be to > others too).

Re: [Pharo-project] About reusing tests via traits

2008-10-06 Thread Bill Schwab
Stef, Alexandre, I will grant you a head start: if you have to copy code, it's not the same thing. My next question would be whether a competitive "say it once" design could be realized with composition and single inheritance. Alexandre refers to use cases the show an advantage, and I do not dis

Re: [Pharo-project] About reusing tests via traits

2008-10-05 Thread Stéphane Ducasse
you can achieve the same with copy and paste or code generation. What is nice with traits is that they represent a bloc of coherent behavior that can be parametrized. Load the latest Collection-Tests from the pharo source. This is just the start but this is quite cool. Check TEmptyTest. It is

Re: [Pharo-project] About reusing tests via traits

2008-10-05 Thread Alexandre Bergel
Traits are not essential. However they simplify the design of complex class hierarchies. Various case studies show this. Last time I use traits when coding was to share identical visit* methods in visitors that do not belong to the same class hierarchies (since they evaluate different interpr

Re: [Pharo-project] About reusing tests via traits

2008-10-05 Thread Bill Schwab
Stef, Dumb question: are traits essential to it, or simply a way of achieving it? Just curious, as I am still trying to put traits in perspective. They strike me (so far, right or wrong) as a form of multiple inheritance, which I have assumed (right or wrong) is often not needed with clever aggr

[Pharo-project] About reusing tests via traits

2008-10-05 Thread Stéphane Ducasse
Hi guys I did a fun coding session in the train to brest. I started to code collection tests as traits (as damien did for stream) and this is realy cool. I could write some tests and apply them to OrderedCollection, Set, Bag, Interval. I will publish that and continue. I imagi