• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Unit testing framework suggestions?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unit testing framework suggestions?


  • Subject: Re: Unit testing framework suggestions?
  • From: "M. Uli Kusterer" <email@hidden>
  • Date: Fri, 24 Sep 2004 14:00:13 +0200

At 4:56 Uhr +0200 24.09.2004, Marco Scheurer wrote:
One reason is that tests can have their own state and ivars, and it wouldn't be a good idea to mix this with the class you want to test.

A-ha! Thanks, that makes a lot of sense. I knew there had to be some obvious reason.


(...)

All the xUnit packages are more or less derived from the original Smalltalk "SUnit". The seminal article is by Kent Beck, and can be found at http://www.armaties.com/testfram.htm . So there is also an historical reason for doing it in subclasses of Testcase.

However, this can be done differently. For instance, Marcel Weiher advocates putting the tests in a category of the tested class.

Yes, that was what I thought. It wouldn't be too hard to use e.g. the preprocessor to remove these tests from the class for the final production build. Since I know that I prefer things that are related (like code and the tests that go with it, or code and its documentation) together in one file, because otherwise it's too easy to have them go out of sync.


But of course, if my test wants to keep state, it'd obviously be a little bothersome to have that in the same class. It would even violate encapsulation, come to think of it. Thanks, I think that aspect is now a little clearer to me.

Just a thought: Does any of the kits have some macros for "default tests"? E.g. some way to just say: Arguments to this function (or its result, or whatever) range from X to Y, and then it would generate code to try the edges of that range (both inside and out) automatically?
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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
  • Follow-Ups:
    • Re: Unit testing framework suggestions?
      • From: The Amazing Llama <email@hidden>
    • Re: Unit testing framework suggestions?
      • From: James Bucanek <email@hidden>
    • Re: Unit testing framework suggestions?
      • From: Marco Scheurer <email@hidden>
References: 
 >Re: Unit testing framework suggestions? (From: Tim Hart <email@hidden>)
 >Re: Unit testing framework suggestions? (From: "M. Uli Kusterer" <email@hidden>)
 >Re: Unit testing framework suggestions? (From: Marco Scheurer <email@hidden>)

  • Prev by Date: Re: How to extend Safari -> Context-Menu, Plugin, traps
  • Next by Date: Re: How to extend Safari -> Context-Menu, Plugin, traps
  • Previous by thread: Re: Unit testing framework suggestions?
  • Next by thread: Re: Unit testing framework suggestions?
  • Index(es):
    • Date
    • Thread