Two Truths I’ve Learned About Writing Clean Rails Apps

In summary: Implement every feature without javascript first, add javascript as a progressive enhancement Stick to REST. Always. Now I’m as suspicious of absolute rules as you probably are, but these two have served me extremely well in keeping my Rails code clean and easy to maintain. I’m happy to push the boat out and …

Using Capybara with RSpec Outside Cucumber

If you want to try using Capybara for browser automation on it’s own, here’s a simple script to get you started: require ‘rubygems’ require ‘capybara’ require ‘capybara/dsl’ Capybara.default_driver = :selenium Capybara.app_host = “http://www.google.com” require “rspec/expectations” class Google include Capybara include RSpec::Matchers def search_for(text) visit “/” fill_in “q”, :with => text click_button “Search” end def ensure_results_contain(expected_text) …

Features != User Stories

User Stories are a great way to plan your work. You can take a big hairy requirement and break it down into chunks that are small enough to work on without anyone freaking out. When you’ve crumbled up your big hairy requirement into little user story chunks, you can pick and choose which chunk to …

Seven Truths Exercise

Recently, I played a game with a team I was training which I called “Seven Truths of Test Automation”. I got each “truth” and wrote it on an index card and put it in a (blank) envelope. I got to the training room early and hid them around the room, not very well, so that …

Installing Ruby Gems with Native Extensions on Windows

If you’re stuck trying to run Ruby on Windows, one barrier you might have encountered is in trying to install a gem like ruby-debug or rdiscount. You’ll have seen an error like this: %gem install ruby-debug Building native extensions. This could take a while… ERROR: Error installing ruby-debug: ERROR: Failed to build gem native extension. …

Photoshop Driven Development, Anyone?

This afternoon I came across a presentation by Michael Tamm on his libary Fighting Layout Bugs. This is an idea that I too, have had bubbling around in my head for some time. Michael, to his credit, has decided to actually do something about it. Michael’s library takes screenshots of sample pages during a test …

The Joy of Craftsmanship

I identify a great deal with the label of “Craftsman”, but some of the rhetoric around the current “Software Craftsmanship” movement bothers me. Why? A little lightbulb went on recently as I read “Let my People Go Surfing”, by Yvon Chouinard, the founder of the outdoor clothing company Patagonia. Patagonia was founded by a group …

The Importance of Being Idle

It says over there on the left that I like to be idle, but I don’t often take the time to write about it. I’m not going to write much now, really, but here’s a thought for you: An idle mind is a questioning, sceptical mind. Hence it is a mind not too bound up …

Outside-In vs Inside Out – Comparing TDD Approaches

At last month’s ScotRUG Brian Swan and I attempted to solve the TDD Avatars problem as a live recital in our chosen style. We each had 35 minutes. The videos are here: Brian’s Inside-Out TDD approach Matt’s Outside-In approach When Brian had walked us through his approach and solution at the last month’s meeting, he’d …

The Fable of the User-Centred Designer

Agile software development is not really about burn-down-charts, unit tests, refactoring or code metrics or even pair programming. At it’s heart, it’s about building software that really works for the people who are going to use it. All those practices you read about are just tools that help you to develop software iteratively, so that …