Bas Thomas Broek

Bas Thomas Broek

iOS Developer @ XING


iOS and tooling developer at XING. Curating Swift Weekly Brief and contributing to frameworks, apps and tooling in open source. I like Swift and experimenting with other programming languages.

Visual Testing - A Communication Problem

At XING, we're heavily using snapshot tests to validate certain scenarios in views. They are super powerful and need next to no code to write. Perfect, right? The problem with these snapshot tests is that they do not tell you what *exactly* they test. And because they are so easy to write, they oftentimes test *too much*. Whereas in an assertion you have a clear message stating its expectation, a snapshot test often threads a more blurry line. There is no communication; the tests **don't speak for themselves**. Couple that with the fact that those snapshot tests are device-dependant (we are running all snapshot tests on multiple devices), and you end up with a scaling problem as well. An operating system change can break all of them — good luck validating all of them again... by hand. This talk will give insights in why we chose for visual testing at the time and what we did when realising they didn't scale anymore. It will cover how we moved away from snapshot testing to plain unit testing, making our testing infrastructure more performant and stable in the process.