Tag Archives: XCTest

Three Ways UI Testing Just Made Test-Driven Development Even Better

via Three Ways UI Testing Just Made Test-Driven Development Even Better · Masilotti.com.

With every Beta, UI Testing is getting better. As of Xcode 7 Beta 4, UI Testing is quickly becoming my go-to feature testing framework on iOS. Combined with XCTest for unit testing, it’s becoming easier to not have to rely on any third-party frameworks. The three big reasons UI Testing offers a huge improvement to TDD on iOS are:

  1. Generic querying syntax
  2. First-class support from Apple
  3. Native asynchronous assertions

XCTest: The Good Parts

via XCTest: The Good Parts.

Since my last post about testing, I’ve been involved with a discussion on Twitter with Apple’s Joar Wingfors:

First, some background on where my critiques are coming from:

  • I’ve been writing unit tests in iOS since 2011, beginning with SenTestingKit.
  • Also around 2011, I began using Kiwi, an open-source testing framework that hooked into +[XCTestCase testInvocations] in order to provide a different way for developers to write unit tests.
  • Also around this time I helped set up continuous integration for the iOS app I worked on at the time, which involved running unit tests from the command line (this was prior to xcodebuild test support). I’ve since done so for many apps, using both Jenkins and Xcode Bots.
  • I became a core member of Kiwi after WWDC 2013, and shipped XCTest support, while also preserving backwards-compatibility with SenTestingKit.
  • Also around 2013 I began contributing to Specta, another testing framework that overrides +[XCTestCase testInvocations] to provide a different way of defining test methods. I recently became a core member of that project as well.
  • When Swift was introduced on June 2nd, 2014, I tried developing a sample app. I was shocked when I realized XCTAssertThrows was unavailable in Swift. I channeled my dismay into a new testing framework–which also overrides +[XCTestCase testInvocations]. I open-sourced the library, called Quick, on June 4th, and have been maintaining it since.