Ben Rigas

Xcode 5 and Test-Driven iOS Development

With Xcode 5, Apple is adding some great tools to make it easier to write unit tests and have Continuous Integration run those tests often.

Xcode 5 is shipping with Apple’s new XCTest framework, which is based on the OCUnit framework that has been shipping with Xcode for a while. Xcode 5 and XCTest make it much easier to see which tests are passing or failing, as well as allowing you to run individual unit tests again with a single button press.

Also new with OS X Mavericks Server is Xcode Server. Xcode Server makes it easy to run Continuous Integration on your applications by creating “bots”. These “bots” regularly build your application and can run all it’s tests on multiple devices.

All of this new stuff is useless if you don’t have any tests to run. If you haven’t already starting doing Test-Driven Development, now is a great time to start. Maybe you’ve used Test-Driven Development before, but you’re not sure where to begin with iOS. I highly recommend picking up a copy of “Test-Driven iOS Development” by Graham Lee.

Most TDD books are intended for Java developers, but this one is focused on building a real iOS application that consumes the Stack Overflow API. It’s been extremely helpful for me to have a real example of Test-Driven iOS Development to follow along with. The book covers almost everything you’re wondering about, including testing network calls and View Controllers. It even has some good advice at the end about how to begin using TDD even when you have an existing application that has no tests.

Start refactoring your code without fear, go get this book.

Check out this book on the iBookstore: “Test-Driven iOS Development” by Graham Lee

First time at WWDC

I’m always excited when WWDC is coming up. You never know what new products or features will be announced, but you know they will be awesome. I’m especially excited this year because I’ll be attending the conference for the first time.

I’ve always watched the keynote and developer sessions online, so I kind of know what to expect there. I’ve been to CTIA several times in San Francisco, so I kind of know what to expect from the location. The combination of the two will be really freaking awesome.

I’ve always felt somewhat isolated as a software engineer, most people I talk to don’t really know what the hell I actually do for a living. So the thing I’m most excited about, and probably least prepared for, is being around so many other developers like me. I work with some really smart people, but it’s hard to imagine 5000 other really smart people in the same place.

How I Roll

For the past 4 years I either had a short 1 mile commute or no commute when working from home, so I didn’t really care much about what car I drove. Since we recently moved, we’re living in a new apartment complex that has a lot of great environmentally friendly features. They have a few public charging stations for electric cars and every garage has some handily 120 and 240 outlets for plugging in electric cars. The apartment is about 10 miles away from the office, so I thought it might be worth it to see if a plug in electric car made sense for me.

There are several options available, but range is a big concern for me because I didn’t want to have to worry much about getting stuck somewhere with a dead battery. Charging an electric car takes a long time, so being stranded with no charge seems like a deal breaker for me. The Tesla Model S is amazing and has a 200+ mile range on a charge, but it’s way out of my price range. The only reasonable option seemed to be the Chevy Volt, which had a 40+ mile range but also has a gas engine that kicks in when the battery gets low. You can drive pure electric as long as you don’t drain the battery all the way, but the convenience of an 8 gallon gas tank allows you to drive it like a regular car when the battery does get drained.

I read a few articles about how there were some good lease deals going on for the Volt, so I went to the local dealer to check it out. I drove up to the dealer in my 2010 Honda Civic, but drove home in my 2013 Chevy Volt.


After driving the Volt for the last couple of months, I can tell you that this is the way most cars will be made in the near future and we’ll look back on our gas engine cars and wonder what the fuck we were thinking.

Chevy did a great job with this car. The electric engine is super quiet and the smooth linear acceleration is something you need to experience for yourself. They also have all the other stuff that you’d expect in the age of the iPhone. Great audio, Bluetooth for voice calls as well as playing music, touch screen controls in the dashboard. It sounds like a freaking spaceship when you push a button to start the car. They have an OnStar iPhone app that lets me unlock the car, start the car, as well as check my battery charge, gas level and even tire pressure. There’s a Volt specific iPhone app that shows your EV miles performance vs other Volt drivers.


It’s not perfect, but it feels like it’s heading in the right direction. For myself, I can say I’ll probably never buy a gas only car again. For my wife, unfortunately it’s still pretty early days and there’s nothing available for driving kids around, someone needs to release an electric minivan or something before that’s a real option.

I love this car. If your total daily commute is less than 40-50 miles and you want to start living in the future, I highly recommend the Chevy Volt.

First world problems about food

4:00pm on any given weekday from Sarah:

“What do you want for dinner? I don’t know, what do you think? No, not that. How about this? Ok, we have everything we need for that but eggs, I think. Can you stop by the store after work and get some?”

5:30pm on any given weekday from me:

“I haven’t left work yet, won’t be able to leave for another 30 minutes at least. Can you make something else for the kids and we’ll eat later when I bring home the eggs? Oh, you can just do some frozen something ok we’ll just go to the store tomorrow.”

We used to just wing it, picking up enough for tonight’s meal and maybe some stuff for tomorrow. This works most of the time, but it added stress trying to decide at the last minute (especially with picky kids that don’t always eat what we do). We would also throw out a lot of food, wasting food and money. There’s enough to worry about every day, so why not eliminate something as simple as meal planning and grocery shopping?

This year we’re trying something a little different, we’re going to try to be as boring as possible and have a weekly routine. For the last 4 weeks, we’ve been shopping on Sunday for the whole week’s meals. We eat the same meal for dinner on the same day of the week: baked chicken on Sunday, red beans and rice on monday, ratatouille on tuesday, turkey meatloaf on wednesday, salmon on thursday, then we order in or go out on Friday and Saturday nights. We make enough food for me to take in for lunch the next day, except for Friday which is my designated go out for lunch day.

Our grocery list is pretty much the same every week, so we have a giant list in Clear that we reuse every week. There’s no worrying if we have enough of something during the middle of the week. We get our shopping done faster, because we know what we get every week and we can optimize for that. We’re still slacking when it comes to budgeting, but getting the same groceries all the time makes a variable expense a little more fixed.

Even though we cook the same thing every week, we do get to experiment to try to improve the recipes. For example, Sarah wants to cut out gluten from her diet, so we dropped the pasta from the ratatouille but everything else is the same so it’s really just a small change.

It seems like such a small thing, but the end result is pretty significant: less stress and more free time. Over time I’m sure we’ll improve the process to allow for some more variety, but we’re eating well and have one less source of constant stress.

The Move, or Shit Happens and Life Goes On

As I sit here on my new balcony typing this, it is January 1st, 2013. It’s remarkable, not just because it’s a new year but also because about 3 months ago I was put in a situation where I had to find a new job. The thought of finding another job is the kind of shit that I dread more than anything, especially considering I’m the sole income provider for my family. How would I get a paycheck now? What about our house that we own, but can’t sell because the housing market still sucks?

Spoiler alert: everything turned out fine.

I’m not the type to want to hop from job to job. I was picky when I took my first job at Interop in Fort Myers, I liked it so much that I stayed for 7 years. We bought a house, had 2 kids and I set up my first saltwater aquarium. It felt good and I wish it could have lasted longer, but I knew I had to move on in order to be where I wanted to be professionally. So, I moved on and took another job that let me work from home. I’ll skip the details, but it didn’t work out. I was only there for about 10 or 11 months. No bad feelings involved, shit happens and life goes on.

Fast forward to now: We’ve been living in Boynton Beach, FL and I’ve been working as a Mobile Software Engineer at Modernizing Medicine in Boca Raton, FL for about 2 months. We’re renting out our house in Fort Myers and our tenants just moved in. My job is awesome, we’re really close to the beach, the kids love it, and there’s a lot more to do here than there was in Fort Myers. Everything is fine, or maybe even better than it was before.

The only thing missing is having some family living nearby, but that’s something I’ll have to write more about later.

Downsizing The Reef


A little more than a year ago I set up my first saltwater aquarium. After a couple months of research and picking Ernie’s brain about it, I decided on a 55 gallon display tank with a 29 gallon sump. Unfortunately it’s not easy to get a single answer on what to do, there are tons of conflicting opinions on various internet forums. Over time I learned a lot about what I needed, but more importantly about what I didn’t need. It really doesn’t need to be as complicated as it seems.

I built my own stand and my own LED lighting with an Ardiuno to control the brightness of the lighting. If you’re interested in the source code, it’s here on github.

As I noted in The Move, we no longer live in Fort Myers so I had to tear down the aquarium. I gave the fish and corals to Ernie and then drained the tank with much sadness.


We’re living in a place with hardwood floors, so keeping an aquarium on that is basically out of the question. It would be way too easy to have a disaster that would cause permanent damage. So, I got a little 8 gallon cube aquarium and put it in the bedroom. It’s a pretty nice looking tank, I like the all-in-one setup with the filtration in the back and the built in LED light isn’t bad.

I’m using some of my equipment that I had on the bigger tank, like my Neptune Apex Jr. Controller to control the lighting, heater and pump. The apex has a companion iPhone app that lets you control the power outlets and view current temperature/pH. I’m also using a Vortech MP10 pump for extra flow, it’s totally overkill but I keep it on a low setting and it keeps the flow randomized. Another benefit to living on the east coast of Florida is that I can buy natural sea water from the local fish store, no more mixing up saltwater myself.