Creating Trust-able Unit Tests in Swift

It may come as a surprise to you, but a green-lit passing unit test is not always a sign that all is well with our software. Our apps and their corresponding unit test suites always start off clean and basic and simple. But they don’t stay that way for long. Cycles of code changes and […]

Testability Tip for Swift Developers – Parameterize and Push

In a previous “Testability Tip for Swift Developers”, I discussed the principle of observability. “If it’s observable, it’s testable” was the primary conclusion of the article, and I pointed toward using the public access control modifier for parts of your app that you intend to test. In this edition, I’d like to introduce a new […]

Improvements to Unit Testing in Swift with Xcode 7

One of the most exciting things that’s come out of WWDC 2015 is the fact that unit testing in Swift has been greatly simplified. The latest announcements have actually rendered a few of my articles on the subject obsolete, once Xcode 7 is in full circulation among the Swift developer community. If you’re using Xcode […]

Testing is to Software as Experiment is to Science

The principle of science, the definition, almost, is the following: The test of all knowledge is experiment. The sole test of the validity of any idea is experiment. These quote came from Chapter 1 and Chapter 2 of the Feynman Lectures on Physics. I’m not a physicist, but the software developer in me resonated with […]

Testability Tip for Swift Developers – Public Over Private

Quite often in unit testing, especially when practicing Test-Driven Development, I find myself wanting to test every single line of code. When I run up against a private function, however, I often scratch my head and ask, “How am I supposed to test this??”. Most experienced testers will tell you, “Don’t test private implementation – […]

Unit Testing Model Layer with Core Data and Swift

Updated on November 19, 2015 – Swift 2.0 As I approached testing my Core Data model, I have to admit I was apprehensive. How in the world was I going to write unit tests for my model layer that depended on a database. Past experience with trying to write tests with databases was painful. I […]

Getting Started with Unit Testing in Swift

Getting set up to write unit tests in Swift, while not difficult, isn’t exactly intuitive. I’ve written several posts and gathered a few resources on unit testing in Swift, but I haven’t yet published a “getting started” guide until now. Where does one get started with unit testing in Swift when they’ve never gotten started […]

Swift Unit Testing – Verifying Method Calls

In this unit testing screencast for Swift developers, we explore how to use Test Driven Development to verify method calls. Getting Started Guide If you’re new to unit testing or are trying to get set up with unit testing in a Swift project, you might check out my getting started guide before jumping into the […]

Swift Unit Testing Resources

As I’ve researched Test Driven Development practices in general, and for iOS / Mac applications, I’ve been helped by several sources. I’ve also discovered a few things the hard way, so I’m combining and maintaining this list of resources to help point you in some helpful directions as you adventure in unit testing your iOS […]

TDD for iOS in Swift – What’s the Goal?

Before actually doing Test Driven Development (TDD) for your iOS / Mac app, it’s really important to ask a very fundamental question: What’s the goal? What am I aiming for when I say I want to drive my iOS development with tests? 2 Goals of TDD in iOS A recent course I watched on Pluralsight […]