I cant think of two ways of anotating:
aClass>>test1
<architectureTest> <integrationTest> ... the test
aClass>>test1
<architectureTest> <integrationTest> <architectureTestAndIntegrationTest> ... the test > But I don't kwnow how to obtain which ones are architecture tests, etc. Using sets and suites, it is simple:
Set architectureTests := Set with: aClass>>test1 with: ... Set integrationTests := Set with: aClass>>test1 with: ... Set archtectureAndIntegrationTests := architectureTests union: integrationTests.
architectureTestSuite := (TestSuite named:..) addTests: architectureTests. integrationTestSuite := (TestSuite named:..) addTests: integrationTests. etc.
If I need to change the categorization, I change the objects (the sets), not a method, and the info about the categories is in one place, not spread all over.
Mhh, I see that different ... ;-)
The problem with your approach is that you categorize your methods at a different places than you define them. Basically this means I have to accept two methods, if I add, change or remove a test.
I do very much prefer your annotation example (1) where I directly tag the concerning method with the necessary meta-information. For me this is much easier to maintain, because I can see immediately when browsing the method to what category it belongs to. Moreover I can quickly query all the currently taged methods by browsing the senders of #architectureTest. Then I get the suite with one line of code, not a method full of selectors defined somewhere throughout the image:
Set architectureTests := MethodAnnotation allNamed: #architectureTest from: aClass.
Cheers, Lukas
-- Lukas Renggli http://www.lukas-renggli.ch