Hi
I would like to kill some tests that do not really make the system better. testMetaclassSuperclass "self run: #testMetaclassSuperclass" self assert: Dictionary class superclass == Set class. self assert: OrderedCollection class superclass == SequenceableCollection class. testSuperclass "self run: #testSuperclass" | s | self assert: Dictionary superclass == Set. self assert: OrderedCollection superclass == SequenceableCollection. s := OrderedCollection new. s add: SequenceableCollection. s add: Collection. s add: Object. s add: ProtoObject. self assert: OrderedCollection allSuperclasses = s. let me know what you think. Stef _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
> testMetaclassSuperclass
> "self run: #testMetaclassSuperclass" > > self assert: Dictionary class superclass == Set class. > self assert: OrderedCollection class superclass == SequenceableCollection class. What is the important is the metaclass relationship, and not really the fact that Dictionary is a subclass of Set. I think this is better: self assert: Dictionary class superclass == Dictionary superclass class. self assert: OrderedCollection class superclass == OrderedCollection superclass class. > > testSuperclass > "self run: #testSuperclass" > > | s | > self assert: Dictionary superclass == Set. > self assert: OrderedCollection superclass == SequenceableCollection. > > s := OrderedCollection new. > s add: SequenceableCollection. > s add: Collection. > s add: Object. > s add: ProtoObject. > > self assert: OrderedCollection allSuperclasses = s. I would rewrite the test as: testSuperclass "self debug: #testSuperclass" | s b | s := OrderedCollection new. b := [:cls | cls ifNotNil: [s add: cls. b value: cls superclass] ]. b value: OrderedCollection. self assert: OrderedCollection allSuperclasses = s allButFirst. self assert: OrderedCollection withAllSuperclasses = s. You even test #withAllSuperclasses in that case. Cheers, Alexandre > > > let me know what you think. > > Stef > > > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
On May 11, 2010, at 9:34 PM, Alexandre Bergel wrote: >> testMetaclassSuperclass >> "self run: #testMetaclassSuperclass" >> >> self assert: Dictionary class superclass == Set class. >> self assert: OrderedCollection class superclass == SequenceableCollection class. > > What is the important is the metaclass relationship, and not really the fact that Dictionary is a subclass of Set. > I think this is better: > self assert: Dictionary class superclass == Dictionary superclass class. > self assert: OrderedCollection class superclass == OrderedCollection superclass class. ok but do you think that the system would work if such test would not work? >> I would rewrite the test as: > > testSuperclass > "self debug: #testSuperclass" > > | s b | > > s := OrderedCollection new. > b := [:cls | cls ifNotNil: [s add: cls. b value: cls superclass] ]. > b value: OrderedCollection. > > self assert: OrderedCollection allSuperclasses = s allButFirst. > self assert: OrderedCollection withAllSuperclasses = s. > > You even test #withAllSuperclasses in that case. this one is more interesting _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
The fact is that in the case that this test fails, besides that most of the system won't work, at least you will have some hint on where could be the problem. Obviously it's only useful if you're playing with the vm.
If we are going test this, (I don't know if we already have it) would be useful to test a basic message sending. And to have a testWellCompiledMethods (or something like that) that checks if all the methods are correctly compiled, e.g.: a method which instead of referencing the instance variable that says in it's source, references the next one. I think that something of that is actually implemented in SmallLint for VASmalltalk, but I may be wrong...
This tests could be some sort of: "if this doesn't work, it's all FUBAR" :) +1 to Alexandre's version.
Cheers, Mariano. On Tue, May 11, 2010 at 5:39 PM, Stéphane Ducasse <[hidden email]> wrote:
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Stéphane Ducasse
On 11 May 2010 23:39, Stéphane Ducasse <[hidden email]> wrote:
> > On May 11, 2010, at 9:34 PM, Alexandre Bergel wrote: > >>> testMetaclassSuperclass >>> "self run: #testMetaclassSuperclass" >>> >>> self assert: Dictionary class superclass == Set class. >>> self assert: OrderedCollection class superclass == SequenceableCollection class. >> >> What is the important is the metaclass relationship, and not really the fact that Dictionary is a subclass of Set. >> I think this is better: >> self assert: Dictionary class superclass == Dictionary superclass class. >> self assert: OrderedCollection class superclass == OrderedCollection superclass class. > > ok > but do you think that the system would work if such test would not work? > I dont quite understand, what this test testing. Yes, in ST-80, a class inheritance chain and metaclass inheritance chain must go in parallel. But there's nothing in VM (to my knowledge), which prevents you from sidestepping from this convention. This means, that a system may work even if such test will fail. I made my own experiments with it , by creating a prototype-based framework , and along with existing prototypes implementation, it serves as a proof, that its not critical for a system to organize your behaviors strictly only in such way(s). > >>> I would rewrite the test as: >> >> testSuperclass >> "self debug: #testSuperclass" >> >> | s b | >> >> s := OrderedCollection new. >> b := [:cls | cls ifNotNil: [s add: cls. b value: cls superclass] ]. >> b value: OrderedCollection. >> >> self assert: OrderedCollection allSuperclasses = s allButFirst. >> self assert: OrderedCollection withAllSuperclasses = s. >> >> You even test #withAllSuperclasses in that case. > > this one is more interesting > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project > -- Best regards, Igor Stasenko AKA sig. _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Stéphane Ducasse
>> What is the important is the metaclass relationship, and not really the fact that Dictionary is a subclass of Set.
>> I think this is better: >> self assert: Dictionary class superclass == Dictionary superclass class. >> self assert: OrderedCollection class superclass == OrderedCollection superclass class. > > ok > but do you think that the system would work if such test would not work? I understand that the point of the original test is to document how metaclasses and superclasses are linked. System like metaclasstalk have demonstrated that this link is not necessary to make a system work. Alexandre _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
yes I added your tests!
Stef On May 12, 2010, at 3:08 PM, Alexandre Bergel wrote: >>> What is the important is the metaclass relationship, and not really the fact that Dictionary is a subclass of Set. >>> I think this is better: >>> self assert: Dictionary class superclass == Dictionary superclass class. >>> self assert: OrderedCollection class superclass == OrderedCollection superclass class. >> >> ok >> but do you think that the system would work if such test would not work? > > > I understand that the point of the original test is to document how metaclasses and superclasses are linked. > > System like metaclasstalk have demonstrated that this link is not necessary to make a system work. > > Alexandre > > > _______________________________________________ > Pharo-project mailing list > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Free forum by Nabble | Edit this page |