Testing
Getting started with unit testing your Swift code on iOS – part 1
Published on: September 30, 2019Recently, I ran a poll on Twitter and discovered that a lot of people are not sure how to get started writing tests, or they struggle to get time approved to write tests for their code. In this blogpost, I will take you through some of the first steps you can take to start writing tests of your own and help you pave the way to a more stable codebase. Why bother with tests at all? You might be wondering why you should bother with code that tests your code. When you put it like that, the idea might indeed...
Read more...Spend less time maintaining your test suite by using the Builder Pattern
Published on: September 16, 2019Often when we write code, we have to initialize objects. Sometimes the object’s initializer doesn’t take any arguments and a simple let object = MyObject() call suffices to create your object, other times things aren’t so simple and you need to supply multiple arguments to an object’s initializer. If you have read my previous post, Cleaning up your dependencies with protocols , you might have refactored your code to use protocol composition to wrap dependencies up into a single object that only exposes what’s needed to the caller. In this blogpost I would like to show you a technique I...
Read more...