My articles, essays, and ramblings.
Getting Started With A/B Testing
To be perfectly honest, this is a subject that I have been ignoring for the longest time. I thought A/B testing was just a buzz word that fancy marketers throw around at unsuspecting clients. Recently, I have been proving my past self wrong and starting to see the light. It first started out with asking myself: “How can I help my clients succeed after their product has launched?” In my programmer’s mind, my first thought was how do we know what works and what doesn’t?
This week I want to show you a simple Rake task I’ve been using for years. It’s one of the very first things I do when starting a new Rails project. I call it reset and it’s purpose is to completely tear down our development environment and rebuild it from scratch. Here is what it looks like:
A Guide for Writing Maintainable Rails Tests
Do you ever feel like you spend most of your day repairing tests in your Rails app? If you have been building Rails apps as long for as we have, then you know the importance of a robust test suite. Working with a brittle and slow tests can really make the most basic tasks difficult. This is especially true for large Rails apps that have been around for a few years.
Minitest Quick Reference
UPDATE: I’ve added a new section on stubbing with MiniTest and a few helpful comments to the code samples. MiniTest, as the name suggests, is a small and fast unit testing framework. Shipped with Ruby 1.9, MiniTest supports a complete suite of testing capabilities such as TDD, BDD, mocking, and benchmarking.
Ruby Blocks as Dynamic Callbacks
Callbacks are a great technique for achieving simplicity and flexibility. Simply put, a callback is a block of code passed as an argument to a method. In Ruby, code blocks are everywhere and Ruby makes it trivial to pass a block of code to methods.
Nyan Cat RSpec Formatter
I watch a lot of tests run in a given day. So I figured why not make it more fun. Inspired by minitest’s pride, and um cats? I came up with a Nyan Cat inspired RSpec formatter. Update: After last week’s launch, Nyan Cat received a great response from the Ruby world. Over the weekend, I released version 0.0.2.