About

My name is Ron Lisle. You can learn more about me on my personal website.

I’ve created this website to focus entirely on iOS Unit Testing. I’m very passionate about unit testing, having previously spent years using Test Driven Development (TDD) on .NET and PHP projects professionally. And now I’m advocating for unit testing on iOS.

Diving into unit testing isn’t easy. Nor is it simple. The concepts are simple, but the actual execution tends to be much more difficult than suggested by many books and blog entries about it. Let me encourage you though. There is a steep learning curve to using unit tests, but once you get over that curve it becomes very easy to develop code using test driven development.

Adding unit tests to existing code tends to be a very frustrating experience. I remember how fired up I got after reading my first article about using automated unit testing frameworks, only to fall into frustration and disappointment upon trying to add unit tests to my existing code. Adding unit tests to code that was written without unit testing in mind is really, really hard! Better to write unit tests and code at the same time. Even better to write the unit tests before the code. This is referred to as Test Driven Development or TDD.

Switching to TDD is typically very uncomfortable. It requires that you really think about the problem that you are trying to solve before writing any code. I know that I am inclined to just start writing code in order to help me organize my thoughts about what the code should be doing. I’ve had to discipline myself to write unit tests to do this, instead of just diving into writing code. Let me encourage you with this. Writing tests instead of code is a much better way to help you think about what you want the code to do.

I began playing with iOS just for fun. I’ve been a professional programmer longer than I’d like to admit, and I have to say that programming an iPhone is just plain fun! So much power, such great development tools, all at a very low cost. And you can carry it wherever you go! I was quickly hooked.

iPhone apps can be created with very few lines of code. This is fun, but leads to writing unmaintainable code. One can throw a few lines of code together to create a starter app, then just keep adding a few lines here and there and watch the app grow into a completely unmanageable mess.

After doing this a few times, I decided to stop playing in iOS and to start using the software engineering practices I had learned and had been using professionally. I would never consider creating a software project without using an SCM. I’m not sure now why I had thought that it would be ok to not use unit tests. So I looked into the unit testing support available then for Xcode 3, and was a bit appalled. I had just assumed that since the NextStep based libraries were so well done, that the supporting testing frameworks would be also. But I dug in, did some experimenting and was able to figure out how to do at least simple unit testing using the integrated SenTestingKit.

Towards the end of 2010, I went from being an iOS hobbyist programmer to becoming a professional iOS contractor. Then in April of 2011 I joined Mutual Mobile, at that time a 2 year old mobile solutions company in Austin, TX. There I started evangelizing the use of unit tests. But the unit testing support in Xcode 3 was horrendous. Even worse was the scarcity of good information about how to unit test in Xcode. I spent a lot of time pouring over blog posts trying to sort things out. Apple’s documentation was of little help.

Things became both better and worse when Xcode 4 was released. Some nice enhancements were made to the unit testing support, and the documentation was improved somewhat, but there was still a lot that wasn’t explained by the documentation. Further, the differences from Xcode 3 were substantial, making nearly all of the existing information on the blogs incorrect. I had to do a lot of experimentation to get even a hazy picture of how unit testing worked in Xcode 4.

I’ve since become the Director of iOS Engineering at Mutual Mobile. With about 50 full time iOS engineers on my team, I am always looking for resources to help them improve the quality of the code they write.

In late 2011 I approached lynda.com about creating an iOS unit testing course, and it was released in April 2012. About the same time, Graham Lee released his book on Test Driven iOS Development. So now there are at least a couple good resources available to help teach iOS unit testing. But we still have a long way to go.

There are still aspects of iOS programming that I haven’t figured out how to test (for example, setting firstResponder). Add to this that Apple is continuously adding to iOS. I attended WWDC 2012, and was disappointed that there was no mention of unit testing. I specifically sought out the unit testing framework guru at Apple, only to find out that there was only 1 person, and he claimed to be new to the Xcode group. Some very exciting new features were announced for iOS 6, but it isn’t at all clear if or how these can be unit tested.
I didn’t attend WWDC 2013, but I was delighted to see several significant unit testing features announced. That’s progress, but we still have our work cut out for us.
I’m going to blog about the solutions I come across for testing iOS code going forward. Please drop me a line if you’d like to share your iOS unit testing successes with me.

3 thoughts on “About

  1. Ron,

    By chance I have been doing your course on Lynda.com.

    I’m new to iOS development, but have been developing for many years. (I wrote my first program in Fortran With Format on an IBM 1620 in 1967.)

    I’m enjoying the course. Any plans for an Xcode 5/ XCTest version?

    Thanks
    Pat

    1. Hi Pat,
      Wow, you go back even further than I do. My first program was on a Univac 1219 in 1974 🙂
      I have been thinking about what to put into another unit testing course, and am still collecting ideas.
      Have you checked out my “Up and Running with iOS SDK” course also? I use XCTest and TDD for all coding. It’s very basic, but you may find it helpful.

Leave a Reply