Articles by Jared Carroll

Jared Carroll

Jared Carroll

Beginning Test-Driven Development in Android

The Android framework contains several familiar and new architectural patterns. Fortunately, testing was not forgotten. In this post, we’ll develop a simple app test-first, exploring both functional and unit testing in Android. We’ll be using the latest Android API, 4.1, and working entirely from the command-line. All the code is available on github.

Primary rainbow
Jared Carroll

Jared Carroll

How to Test External APIs

Integrating with an external API is almost a guarantee in any modern web app. To effectively test such integration, you need to stub it out. A good stub should be easy to create and consistently up-to-date with actual, current API responses. In this post, we’ll outline a testing strategy using stubs for an external API.

Purple waves
Jared Carroll

Jared Carroll

Supporting Cross-Domain AJAX in Rails using JSONP and CORS

The recent rise in popularity of client-side JavaScript MVC frameworks has led to a revival of web apps with thick clients. As more logic is moved to the client-side, the need to communicate with servers in different domains becomes more common. Unfortunately, JavaScript’s same origin policy prohibits you from making a request to a server

Jared Carroll

Jared Carroll

Beginning Outside-In Rails Development with Cucumber and RSpec

The RSpec Book defines outside-in Rails development as starting with views and working your way in toward the models. By developing from the outside in, you are always taking a client perspective at each layer of the application. The end result is an absolute minimum implementation, consisting of simple, expressive interfaces. Outside-in development doesn’t require

Red paint
Jared Carroll

Jared Carroll

Does My Rails App Need a Service Layer?

Sometimes during domain modeling you come across something that isn’t a thing. These operations that don’t quite belong to an object are called services. Services often live in a separate, service layer. The service layer lies between controllers and models, defining an application’s interface, its API. Designing with services and a service layer is popular

Jared Carroll

Jared Carroll

Exploring Client-side MVC with Backbone.js

Backbone.js continues to gain popularity in the JavaScript MVC community. I decided to give it a try by creating a simple, single-page app to CRUD a single domain model. While it wasn’t as trivial as a traditional server-side implementation in Rails, it did turn out relatively clean. This is a long post, and if you

Jared Carroll

Jared Carroll

Modern Cucumber and Rails: No More Training Wheels

Last month, cucumber-rails 1.1 was released. This release removed web_steps.rb, a collection of step definitions for interacting with a web app. For months, web_steps.rb contained a warning of its negative effects on feature maintenance. Like most developers, I ignored the warning. During a recent upgrade of an existing Rails app, I realized it was now

Jared Carroll

Jared Carroll

Why Your Daily Standup Sucks (and how to fix it)

The daily standup is the “Hello World” of agile development. It’s a daily, 15-minute meeting, about the current status of a project. Each participant answers three questions: what did I do yesterday, what am I doing today, what is in my way. Sounds simple, right? However, it’s surprisingly easy to turn a standup into another

Colors
Jared Carroll

Jared Carroll

Vim Text Objects: The Definitive Guide

To edit efficiently in Vim, you have to edit beyond individual characters. Instead, edit by word, sentence, and paragraph. In Vim, these higher-level contexts are called text objects. Vim provides text objects for both plaintext and common programming language constructs. You can also define new text objects using Vim script. Learning these text objects can

Jared Carroll

Jared Carroll

Crafting Commits in Git

A commit, like a well-designed function or class, should represent a single concept. A distinct, cohesive commit is easy to understand, review, and, if necessary, revert. Git’s powerful staging area allows you to finely craft your commits. You decide which files and even which changes in a file, down to the individual line level, to