Categories
mobile Programming

Creating Test Images and Comparing UIImages

I’ve been working on this app which relates to my obsession with color. It’s an image processing app, and you can see some pictures made with it on our Tumblr. This involved learning about how to take images apart and put them back together, rewriting a lot of stuff in C for performance, etc. But […]

Categories
Programming

Getting KIF Set Up

Continuing my obsessive testing strategy, I had to set up KIF for UI Automation Tests. Honestly it’s surprising I didn’t do it earlier, but since the UI is very simple I was getting better ROI doing unit tests – I see KIF as a sanity check, not as a way to debug anything. Step 1: […]

Categories
Programming

In Defence of Static

Maybe it’s my functional programming background, but I love static methods. Not everyone gets this, some people parrot the phrase “static methods are bad for testing” but don’t seem to understand what that means. Static methods are great for testing. Inputs in, outputs out, side effects – what side effects? What’s not to love? What they […]

Categories
mobile Programming

iOS Testing: Handling Asynchronous Code

I was handling a common occurrence when doing something that takes a noticeable amount of time on iOS. Show loading UI. Do work. Transition to post-work UI. To make the experience better (so that it doesn’t lock up), I pushed 2 onto the background thread, and then had to push 3 back on to the […]

Categories
mobile

Better Testing of View Controllers on iOS: Part 2

When I previously wrote about better testing of view controllers on iOS I alluded briefly to the strategy of breaking the ViewController into a ViewController and a Presenter. Again, I won’t go into mocking here, but you need a mocking framework and some understanding of what mocking is for this to make sense. Currently, I’m using OCMock. […]

Categories
Programming

#iOSDevUK: Jon Reid – Controlling Dependencies to Enable TDD

My notes from John Reid‘s talk at iOSDevUK. Barriers to TDD. Two primary: Not knowing what it is. Rejecting it as silly without giving it a try. A good try, as there is a learning curve. It will slow you down at first. If you give up before the payoff then you will say “oh […]

Categories
mobile Programming

Better Testing of View Controllers on iOS

When I started testing iOS apps, which shamefully was not when I started writing iOS apps, I discovered the biggest impediment to thorough testing on iOS was the View Controller, and it’s mix of UI code, and not. Now I’m working on my first independent app (yay!) of course I am writing extensive unit tests. I won’t […]

Categories
Education job hunting Programming

Test Driven Revision

For my interview this week, I was sent a list of things to prep. One of them was sorting algorithms. The best way for me to remember and understand them is to code them, and I decided to go through the list on Wikipedia and code them in Java – even the recursive ones. I […]

Categories
Programming

Testing Code that Depends on Remote APIs

This is something I did for a course I’ve been taking, but as I couldn’t find much information thought it might be helpful to document it here. Let me know if there’s anything you think I’ve missed! Overview The internet is a rich source of dynamic data, and is increasingly used in our applications. Many […]

Categories
Programming

The Desire for 100% Coverage

I recently handed in an assignment on testing. It was fairly simple, and I expected it to take just a couple of hours and not teach me anything. That was not  the case. I really think that every situation is an opportunity to learn something (even if it’s not what you think you will). Lesson […]