OCUnit Logic Tests Are Dead

… long live OCUnit Application tests.

I’ve been espousing the use of logic tests for quite awhile now. But recently, I’ve had a chance to work with some projects that have a fairly large number of OCUnit application unit tests. To my surprise, these tests run very fast, roughly sub-second per hundreds o tests.

Of course, test execution times will vary depending on the individual project and tests, but it appears that in general, there’s no need to jump through hoops using OCUnit Logic tests, since simply using OCUnit Application tests should work just fine.

This also applies to GHUnit. I’ve seen a project with over 600 tests execute in under 2 seconds.

Anyone have observations that disagree with this?

 

2 thoughts on “OCUnit Logic Tests Are Dead

  1. For me performance isn’t the main reason to use logic tests. It’s the fact that they can be run without a GUI. This has two advantages: They can be run automatically during each Xcode build. And they can be easily run on a CI server with no access to the window manager.

    I really wish there was some kind of headless iOS simulator…

  2. I also have one more advantage / necessity. My http requests unit tests using Nocilla (https://github.com/luisobo/Nocilla) cannot be run in Application tests because when my application starts it fires some requests making my tests fail since Nocilla catches them and throws an exception (Unexpected request).

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.