Re: Unit testing framework suggestions?
Re: Unit testing framework suggestions?
- Subject: Re: Unit testing framework suggestions?
- From: Marco Scheurer <email@hidden>
- Date: Sun, 26 Sep 2004 20:57:05 +0200
On Sep 26, 2004, at 13:59, Marcel Weiher wrote:
Hmm...I guess I should (have) advertise(d) MPWTestKit a little more
heavily, because it has these attributes. There are hooks for more
flexibility if you need it, but the basics are absolutely trivial.
+testSelectors
{
return [NSArray
arrayWithObjects:@"myWonderfulTest1",@"myWonderfulTest2",nil];
}
+myWonderfulTest1
{
}
+myWonderfulTest2
{
}
Hey, now I have to disagree with not only Georg, but also Marcel!
Don't you think that the fact that these tests need to be in class
methods smelly? Of course you keep them "close" to the tested class,
but you still have an instance of one class testing an instance of
another class.
If the idea is to have both testing and tested code in the same file,
nothing forbid having two classes in the same file either.
And I don't buy the argument that writing tests in a category rather
than a class change the whole perspective on unit testing and how it
makes it so much more integrated in the development activity.
Of course OCUnit has TestCase and TesSuite, but that's an
implementation detail with which nobody needs to care if they don't
want to. They are not getting in the way of writing tests. For
instances TestSuite are automatically created to group the test cases
of different compilation units.
I'm a fan of categories, but in that case, I don't see the point.
Writing a test using OCUnit and, I suppose, many others is just as
trivial:
@implementation MyTestCase:TestCase
- (void) testWonder1
{
}
@end
One way or another the only required activities are to write test
methods and to run them.
Marco Scheurer
Sen:te, Lausanne, Switzerland http://www.sente.ch
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden