Recently some of my controller actions have taken on a definite new shape. Particularly when the action is a read-only query of the app’s state. Such actions tend to make up the bulk of my apps, and they can be simple because they are unlikely to “fail” in any predictable way. Here’s an example from […]
January 30, 2013
TL;DR Longer methods are more likely to need to change when the application changes. The Longer Story Shorter methods protect my investment in the code, in a number of ways. First: Testability. I expect there to be a correlation between method length (number of “statements”) and the number of (unit) test cases required to validate the method […]
January 18, 2013
The blog post Cucumber and Full Stack Testing by @tooky sparked a very interesting Twitter conversation, during the course of which I realised I had fairly clear views on what tests to write for a web application. Assuming an intention to create (or at least work towards creating) a hexagonal architecture, here are the tests […]
November 4, 2012
Two years ago the fantastic staff at Macclesfield hospital saved my life. To cut a long story short, my colon burst due to diverticular disease; Mr Khan and Mr Hadjiloucas correctly diagnosed it and operated in the nick of time. (Seriously. Two hours later and I would have been gone.) I had two 6-hour operations […]
September 3, 2012
Like most developers I know, I have used code smells to describe problems in code since I first heard about them. The idea was introduced by Kent Beck in Fowler’s Refactoring back in 1999, and has taken root since then. The concept of code smells has several benefits, not least the fact that it gives […]
July 11, 2012
If I’m thinking about my Rails app in terms of a hexagonal architecture, I find it also pays to consider every rake task to be an Adapter. Thus: The true picture is a little more complicated than that, but the principal ideas are there. The rake task acts as a mediator, allowing me to send […]
July 6, 2012
This is a brief follow-up to the Hexagonal Rails sessions I did last week at the Scottish Ruby Conference with Matt and Steve. We tried to cram a 3-day course into 45 minutes, with inevitable consequences. So by way of an apology, here’s another brief foray into some of the same territory… Today I’ve been […]
May 14, 2013
1