Let’s welcome our next-in-line speaker at MobOS 2020, Vincent Pradeilles!
Vincent started working on iOS apps back in 2011. For the last years, he’s been working at Worldline, where he contributes to building great apps for major French banks. He loves Swift and enjoys sharing about it on the Internet. Most notably, he built the framework KeyPathKit that implements a SQL-like syntax for data manipulation. He’s also the one behind the Twitter account @ios_memes.
His topic will be around “Taking the boilerplate out of your tests with Sourcery”.
Code generation has always been something of a controversial topic, with many engineers not liking the idea of a codebase that relies too much on this topic. Yet, when used appropriately, this tool is a great help to minimize boilerplate code. In many iOS projects, the testing targets are definitely places that tend to be cluttered with boilerplate and duplicated code. Sourcery is a code-generation tool for Swift that, when applied appropriately, can dramatically reduce the amount of boilerplate. In this talk, I’m going to show you how it can be leveraged for quick wins, such as making sure that your dependencies are correctly registered and injected. But also to create building blocks for more involved test scenarios, such as mocks that keep track of how many times methods get called, along with the provided arguments. And, of course, if your app uses an architecture that relies on a set of well-defined components (like base classes of ViewControllers, ViewModels, Providers, etc. with pre-defined methods), Sourcery can definitely be applied to generate a testing suite that will assert that those components behave as expected.
We’re getting really excited, have you secured your seat?