• 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: Georg Tuparev <email@hidden>
  • Date: Sun, 26 Sep 2004 22:44:04 +0200


On Sep 26, 2004, at 8:23 PM, Marco Scheurer wrote:


On Sep 26, 2004, at 19:25, Christian Pekeler wrote:

On Sep 26, 2004, at 5:37, Marco Scheurer wrote:
Another difference is of course that by writing the tests in a category, you have access to the internal state of the class (like the ivar tableWindow), and you do not need access methods...

A good suite of unit tests enables refactoring. However, if the tests access internals of the production code, the tests are getting in the way of refactoring (because they would always need to be changed together with the production code). That's why I think ideally unit tests should only test the public/official api, for which categories are not necessary.

Oh yes, I agree totally. I did not see this as an advantage, just a difference.


Marco Scheurer
Sen:te, Lausanne, Switzerland   http://www.sente.ch

Wait a second folks. I thought the discussion was about Unit Tests and not about Acceptance Tests. Besides, if I cannot tests internals of a class, who will give me the courage to refactor these internals? Often these internals make more then 90% of the class. For example a Telescope class might have a public method isTracking that simply returns a BOOL ivar set by an internal method called 10x each second that that corrects the geometry of the flex mirror, reads a frame from the helper CCD, does some nasty image convolution, calls eigen vectors based RMS routine and passes the result to a weighting function that finally decides if the telescope is still tracking or the object was lost. For a user of the class Telescopes these might be unimportant details, but for me - the author of the class - these are the most important methods, and I would like to be able to test them no matter if someone have academic or other objections...


BTW, a good suite of tests enables refactoring by first braking few existing tests! If I make even a simple refactoring, say "rename method", and my test bar is still green I know I am in trouble and I do not have enough tests! When the tests are broken, I start fixing them. When the bar is green again, I commit. If the bar stays red for longer then an hour, I revert.

Georg Tuparev
Tuparev Technologies
Klipper 13
1186 VR Amstelveen
The Netherlands
Mobile: +31-6-55798196

_______________________________________________
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: Martin Häcker <email@hidden>
    • Re: Unit testing framework suggestions?
      • From: Malte Tancred <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>)
 >Re: Unit testing framework suggestions? (From: Georg Tuparev <email@hidden>)
 >Re: Unit testing framework suggestions? (From: Marco Scheurer <email@hidden>)
 >Re: Unit testing framework suggestions? (From: Marco Scheurer <email@hidden>)
 >Re: Unit testing framework suggestions? (From: Christian Pekeler <email@hidden>)
 >Re: Unit testing framework suggestions? (From: Marco Scheurer <email@hidden>)

  • Prev by Date: windows and panels
  • Next by Date: Re: [NEWBIE]: Selecting Cells in a Browser
  • Previous by thread: Re: Unit testing framework suggestions?
  • Next by thread: Re: Unit testing framework suggestions?
  • Index(es):
    • Date
    • Thread