All Articles

Most Popular Articles

A Rails testing “hello world” using RSpec and Capybara
If you’ve never written a test in Rails before, this guide will make it easy to write your first one. Includes video.

A repeatable, step-by-step process for writing Rails integration tests with Capybara
Perhaps the hardest part of writing a test is just figuring out how to get started. This guide provides an easy step-by-step process to follow so that you never get stuck before you start.

RSpec/Capybara integration tests: the ultimate guide
If you’ve written a few RSpec/Capybara integration tests but you want to understand integration tests more deeply, this guide will help. This guide will also help if you’re confused about testing terminology.

Technical Articles

Ruby/Rails Testing

Which test framework should I learn, RSpec or Minitest?
What are the different kinds of Rails tests and when should I use each?
What are all the Rails testing tools and how do I use them?
What level of test coverage should I shoot for?
How do I make testing a habitual part of my development work?
How do I add tests to an existing Rails project?
Should I be doing test-driven development?
How to get started with Rails testing
A Rails testing “hello world” using RSpec and Capybara
A Rails model test “hello world”
Rails model spec tutorial
How I set up a Rails application for testing
Testing implementation vs. behavior in Rails
My general approach to Rails testing
What kinds of Rails tests I write and what kinds I don’t
RSpec/Capybara integration tests: the ultimate guide
A repeatable, step-by-step process for writing Rails integration tests with Capybara
How to write a test when the test implementation isn’t obvious
Understanding Factory Bot syntax by coding your own Factory Bot
How to deal with complex Factory Bot associations in RSpec tests
Nested factories in Factory Bot: what they are and how to use them
When to use Factory Bot’s traits versus nested factories
Transient attributes in Factory Bot
Examples of pointless types of RSpec tests
The difference between let, let! and instance variables in RSpec
Why I don’t use Shoulda matchers
Ruby/Rails testing glossary
Rails testing resource roundup
Factories and fixtures in Rails
How I set up Factory Bot on a fresh Rails project
Where to start with introducing TDD to a new Rails app
Why use Factory Bot instead of creating test data manually?
How I write characterization tests
Refactoring to POROs (using tests)
How to clear up obscure Rails tests using Page Objects
Test smell: Obscure Test
Code smell: long, procedural background jobs (and how to fix it)
Testing private methods
How I test JavaScript-heavy Rails applications
RSpec mocks and stubs in plain English
How to test methods that involve puts or gets
Mystified by RSpec’s DSL? Some parentheses can add clarity
Sometimes it’s better for tests to hit the real API
Common causes of flickering/flapping/flaky tests
How dependency injection can make Rails tests easier
Things you can ignore when getting started with Rails testing
Taming legacy Ruby code using the “Sprout Method” technique, example 1
Taming legacy Ruby code using the “Sprout Method” technique, example 2
When I use controller/request specs in Rails and when I don’t
The difference between integration tests and controller tests in Rails
The difference between RSpec, Capybara and Cucumber
The difference between system specs and feature specs
How to get RSpec to skip view specs when you generate scaffolds
RSpec hello world
Testing anti-pattern: setup data leak
Achieving blur in capybara
Capybara: expect field to have value
Logging the user in before Capybara feature specs
Why I recommend against using Cucumber
How to see your feature specs run in the browser
How to run system specs headlessly or not headlessly at will
A VCR + WebMock “hello world” tutorial
Avoiding network calls in Rails tests without using mocks, stubs or VCR
Rails scaffolding and TDD are incompatible (but that’s okay)
In which I dissect and improve a Rails test file I found on Reddit
Reader Q&A: Tommy’s question about testing legacy code

General testing

Using tests as a tool to wrangle legacy projects
How I approach test coverage metrics
The five benefits of automated testing
What if I want to do test-first but I find it easier to do test-after?
Deploy to production on day one
What a “walking skeleton” is and why I always start projects with one
What exactly makes “bad” code bad?
Why “users don’t care about code” is a bad saying
“We don’t have time to write tests”
Atomic commits and testing
All code eventually gets tested, it’s just a question of when and by whom
Continuous integration
How do you tell which areas of a project’s test suite need attention?
What should I NOT write tests for?


Where to put Rails modules
How I organize my Rails apps
How I keep my Rails controllers organized
What to do about bloated Rails Active Record models
When used intelligently, Rails concerns are great
What is a Rails model?
Understanding Ruby Proc objects
What the ampersand in front of &block means
Understanding Ruby blocks
How to restart Sidekiq automatically for each deployment
How to run RSpec with headless Chrome/Chromium on Alpine Linux
Active Record queries in views: when it’s bad, when it’s fine
Understanding Rails secrets/credentials
Extracting a tidy PORO from a messy Active Record model
Beware of “service objects” in Rails
How I code without service objects
Don’t wrap instance variables in attr_reader unless necessary
Lessons I learned converting all my database IDs to UUIDs
My top five Rails performance tips for performance noobs
My vim setup for Rails


A Docker “hello world” app
Docker concepts and terminology
The difference between Docker and Docker Compose
How to Dockerize a Rails application (“hello world” version)
My hybrid approach to Dockerizing Rails applications
How to Dockerize a Sinatra application
How run a PostgreSQL database in a Docker container
How and why to Dockerize your Rails app’s database
The two ways to Dockerize a Rails application

General programming

All my best programming tips
A systematic methodology for solving any programming problem
When to refactor
Don’t mix refactorings with behavior changes
Close your f-ing browser tabs
The purpose of private methods and when to use them
A model is not a simulation
My take on the Single Responsibility Principle
Stuck on a programming problem? These tactics will get you unstuck most of the time
Variable name anti-patterns
Logical arguments for programmers
10x programmers
How to have a productive programming day
How I approach software estimation
Common legacy project challenges and how to address them
Unlike real debt, technical debt is unavoidable
The difference between domains, domain models, object models and domain objects
How to defend good code
Who’s to blame for bad code? Coders.
“Perfect is the enemy of the good” is a false dichotomy
“It’s ugly but it works”
How I make sure I really understand a feature before building it
Why small stories are better than big ones
Refactorings should be atomic
How to perform hotfixes without side effects or extra stress
Why the boy scout rule is insufficient
My favorite debugging techniques
My Git aliases
Git workflow anti-patterns
My first attempt at a genetic algorithm
My second attempt at a genetic algorithm


How to deploy a Ruby on Rails application to AWS
How to deploy a Ruby on Rails application to AWS Elastic Beanstalk
How to launch an EC2 instance using Ansible
How I wrote a command-line Ruby program to manage EC2 instances for me
How to generate a public key from a private key

Non-Technical Articles

Developer success == individual * environment
How to get traffic for a technical blog
How to get a team to get behind an engineering project
My experience speaking at 7 tech conferences in 9 months including RailsConf, RubyHACK and RubyConf India


RailsConf 2019 – Coding with an Organized Mind
RubyHACK – Using Tests as a Tool to Wrangle Legacy Projects
RubyConf India – Using Tests as a Tool to Wrangle Legacy Projects
Chicago Angular Meetup – Introduction to Angular 2