Core Data and Unit Testing haven't always been the best of friends. Like two members of the same friend group who don't really know each other but really like their UIKit friend…
#testing
13 posts with this tag
Firefighters are portrayed, quite rightly, in our society as heroes. They courageous run into dangerous situations and save people. However, let's think about why we need firefighters…
Most iOS apps will have a networking component, in previous posts I've written about treating the network call and parsing as one task [https://williamboles.com/networking-with-nsoperation-as-your-wingman/] or how to cut down on unneeded network calls by coalescing [https://williamboles.com/remo…
When I first created ConvenientFileManager [https://github.com/wibosco/ConvenientFileManager] I didn't add a unit testing target - what can I say, I was young(er) and foolish. Recently I decided to rectify this grievous error and added a unit testing target. After writing the tests I pushed them…
Cohesion is important for your application. Each unit of work should have a clear purpose and clear area of responsibility, this is known as the Single Responsibility Principle [https://en.wikipedia.org/wiki/Single_responsibility_principle] (SRP). If you find that you are working on a method/class t…
Dependence injection (DI) is a useful technique to have in your unit testing toolbox. It's were we take implicit dependencies that our method/class rely on and make those dependencies explicit. It's especially useful when writing unit tests as it allows us to avoid using the black magic of m…
If you have ever written a unit test, chance has it that you used either black or white box testing techniques to determine what that unit test was testing. In this post I want to explore both these techniques and look at when we should be using them. Black-box techniques Black-box testing is wer…
I find it surprisingly hard to get new developers to really engage with unit testing but then when I think back to when I had just graduated and what I thought about unit testing: I'm here to write code, not to test! I shouldn't be surprised. Unit testing works slightly counter intuitivel…
iOS hasn't always been the most unit-test friendly environment, but since Xcode 4 this has changed - a lot of the setup has now been automated away for us. These improvements make adding unit tests to your application easier than ever. However, the question remains: What should be tested? Wha…