Mobile App Case Study
Buy the entire series and save $32 (streaming) + $32 (download)!
8. Going Functional
By Robert C. Martin and Justin Martin, 1h 6m

OK, so we went with the family to Orlando for Christmas vacation. And then Justin says, "Hey Dad, let's do an update on our Mobile App Case Study."

How could I say no to an invitation to write code with my youngest son? So, code we did, and we asked Angela to film it.

What motivated this were the letters we got from you guys, the viewers (thank you all!) One of the things you asked is, why we didn't do a more functional implementation?

We also wanted to clean up a few dangling issues and update the source code to the newer Swift style.

So, enjoy our Christmas vacation with us.

7. Architecture
By Robert C. Martin and Justin Martin, 58m

In this episode: straightening out the mess.

Justin and I retire to our Summer retreat, and refactor the application to conform to a nice, clean, architecture.

Our goal is to separate the games rules, the data, and the GUI into separate components that have a plugin structure. We want the GUI and the Data modules to plug in to the Game rules.

This takes three tomatoes of dependency breaking and reforming, while keeping the tests passing.

And in the end we've created the seed crystal around which this application can continue to safely grow.

The github repository for this series can be found at:

6. Resolution
By Robert C. Martin and Justin Martin, 1h 18m

We're done!

Yep. We got the whole thing working!

Well, almost. I mean, good enough for this video series.

This episode began with a big up front design for detecting wins. And then we abandoned that and adopted an incremental approach that got us 2/3 of the way there. The rest is in sight.

We also played around with the dependencies a bit, debating which modules should depend on which other modules.

And then...

Uh, oh!

We looked at the overall structure of the system. We drew the diagram on the board. And we discovered that after 6 hours of work, 18 tomatoes, we had built a rat's nest of dependencies.

We can't leave it like this!

And so, we have one more episode to do. We need to fix the architecture.

The github repository for this series can be found at:

5. Policy & Presentation
By Robert C. Martin and Justin Martin, 1h 16m

In this episode: the Architecture intrudes.

We start to see the architecture rearing up and asserting itself, which begins with a discussion about the turn-taking policy. Where does that belong? And, in which direction should the dependencies point?

This leads to the adoption of the Model-View-Presenter pattern, to decouple the testable from the untestable portions of the GUI.

Various dependency management techniques are tried, including one using lambdas that ends up burning our brains at the end of the episode.

Oh, yeah, and we get caught by that refactoring we did last episode, when we removed all the keyword arguments.

Anyway...the Architecture has begun.

The github repository for this series can be found at:

4. Seriously, We Lost It!
By Robert C. Martin and Justin Martin, 56m

In this episode: a spasm of refactoring.

A spasm of refactoring in which we lost the video of the first tomato—thankfully!

Yes, it's true. We lost the first tomato. Well, we didn't lose it. We just forgot to hit the record button.

But don't worry, we summarized it for you.

We also sped up the tests!

Well, we think we did anyway. It's kind of hard to'll see. But, Justin does a nice job showing you how to do it.

Exceptions eliminated!

Anyway, we got down to business in the second tomato by removing all the horrible exceptions and replacing them with tuple-based error returns. As it turns out, this worked pretty well.

We also walked through the code, replacing most of the keyword arguments with positional arguments—something that Swift does not make particularly convenient. We did this because the code just looked better once it was done.

And then we found a torture device and subjected ourselves to it.

The github repository for this series can be found at:

3. Chugging Along
By Robert C. Martin and Justin Martin, 1h 13m

OK, Enough of this Model First nonsense. Let's write the GUI!

And let's write the GUI in a language that has static typing cranked all the way to 11; and that interfaces to a framework that was designed for a dynamically typed language!

What could go wrong?

Actually, our dynamic duo does a pretty good job of it. Despite struggling with floating point numbers and the strange path structure, in three tomatoes they get a functioning GUI on the screen.

There's just one problem: they didn't write any tests. Wasn't this series supposed to teach TDD?

Ah, but TDD and GUIs...

The github repository for this series can be found at:

2. Proceeding with Precision
By Robert C. Martin and Justin Martin, 1h 21m

In this episode our intrepid pair continue to employ the Model First principle by adding more capability to the game board as well as beginning to build the rules that will detect wins.

Frustration mounts with the tool, the speed of tests, and the language, causing the pair to eventually resort to long dead german poets to vent their angst.

Exceptions begin to rear their ugly head, setting the pair on a path that will trouble them for several episodes to come.

The github repository for this series can be found at:

1. Getting Started
By Robert C. Martin and Justin Martin, 1h 22m

"Hey Justin, you're something of a mobile app expert nowadays, aren't you?"

"Well, I have built several significant iPhone apps for various clients over the past few years..."

"Do you want to do a video series on the topic?"

"Sure, Dad. That sounds like fun. Actually, I've been learning Swift. Do you want to do the videos using Swift?"

"Swift, eh? Sure, why not. I don't mind learning a new language. We can do TDD right?"

"Yes, the tools support TDD, no problem."

"Great! OK, so let's write a simple Go-Moku app."

"You mean that five-in-a-row game you play on a GO board? That sounds like fun. So what are we trying to teach in this series?"

"Well, I think our focus should be to use the series to teach the following principles:

<ul class="bulleted-list>

  • TDD—How to do Test Driven Development, for a mobile app, in Xcode and Swift.
  • Pairing—You and I will pair program, and talk through our issues so that the viewers can follow along.
  • Pomodoro—We'll use the Pomodoro time-management technique both to structure the videos, and to manage our time.
  • Model First—We'll drive the development by building the business rules first, and then fit the GUI, network, and data access in later.
  • Clean Architecture—We'll separate the GUI, Business rules, data access, etc. into separable components. Keeping the architecture clean.
  • Dependency Management—Using OO, we'll create a plugin structure between those components that will allow the application to scale.
  • Swift—And, we'll explore some of the interesting language quirks and features of Swift.
  • "OK, so just normal, professional, mobile development. I'm on board. Sounds like a hoot. Let's go!"

    The github repository for this series can be found at:

    0. Intro
    By Robert C. Martin and Justin Martin, 3m

    This is our free introduction to the Mobile Application Case Study, in which we develop an iPhone app using Swift.

    Get ready for quite a trip as we spend 7 episodes (21 tomatoes) to TDD our way to a GoMoku application using XCode and Swift.

    As you watch us you'll see the problems we had with the IDE, with the language, and with the framework. You'll also see how we solve them, and drive the application from its initial meager beginnings to a final scalable architecture.

    So, buckle up, because this is one cool ride.