Test-Driven iOS: Introduction to Feature Tests

In past articles about test-driven iOS, I have talked about how to resolve some challenges of unit testing an iOS app. This time I’ll talk about higher level tests that validate how the view looks and behaves when users interact with it (UI tests) as well as the app’s API requests and response handling (integration tests).

A feature test validates both the UI and the API calls of an app to document how a feature should work.

Today we’ll look at an example feature test in Swift. I’ll start by explaining the structure and purpose of feature tests, but you can skip to the code if you prefer.

Continue reading “Test-Driven iOS: Introduction to Feature Tests”

Test-Driven iOS: Testing an App with Storyboard UI

In this post a while back, I mentioned two options for setting up unit test-friendly dependency injection in an iOS app: dependency injection libraries and constructor injection with code-defined views. In that piece, I talked about using a code-only UI to achieve my testing goals.

Since then, I have learned a few more strategies that allow me to unit test my iOS apps while still defining the views through the storyboard, as Apple intended. Here I’ll share some of what that looks like with you.

Continue reading “Test-Driven iOS: Testing an App with Storyboard UI”

Diagramming Data, Part 3: Preventing and Curing Data Deficiencies

In part 1 of this series, we discussed the relationship between data and code complexity. In part 2, we talked about some of the deficiencies datasets might have and how they happen.

Now we’ll talk about some starting points for building healthy datasets—and nursing deficient datasets to health as much as possible. It’s important to note that these starting points apply chiefly to datasets obtained via human data entry—generally via a form.

Continue reading “Diagramming Data, Part 3: Preventing and Curing Data Deficiencies”