Category Archives: quality

On Testing “Trivial Code”

I can’t resist jumping on the band-wagon and telling people that they’re wrong, so here goes… Mark “Ploeh” Seemann wrote a post on testing trivial code. There have been several responses saying he’s wrong and that you shouldn’t test trivial … Continue reading 

| Leave a comment

Some Notes On Screencasting

I put together some notes for my team, on building some screencasts. I thought they came out fairly well, so I wanted to share with the rest of the world.  Note that these are my opinions based on the work … Continue reading 

| 11 Comments

A Better Solution For Partial View Controllers

A few days ago, I wrote about using the Cells gem to create an encapsulated segment of my app, with view and controller, etc. Well, this didn’t work out so well after all. Aside form the initial problem of `content_for` … Continue reading 

| 1 Comment

Cleaning Up Rails Helper Methods With A Helper Class: Good Idea, Bad Idea, Or ‘Meh’?

I found myself writing a very ugly helper method in my rails ApplicationHelper module: def render_program_dashboard(patient_program) key = patient_program.program.key content_for :css do stylesheet_link_tag “#{key}/patient_program” end dashboard_instance = nil dashboard_class_name = “#{key.to_s.classify}::ProgramDashboard” begin dashboard_class = dashboard_class_name.constantize dashboard_instance = dashboard_class.new(patient_program) rescue Rails.logger.info … Continue reading 

| 2 Comments

Cells: Partial Controllers And Views For Rails 3

I’ve got a sort-of meta-application that I’m building in Rails 3 for a client. The core of the application is a framework on which we build various “Programs” that a patient can participate in. On the Patient Profile screen, a … Continue reading 

| 5 Comments

Mocks, Stubs and Unreadable Tests: Clearly I’m Doing This Wrong

I tweeted this a few minutes ago: This is in reference to a horrible test that I wrote today. It’s got 2 assertions and more than 20 lines of context to set up the mocks that I needed, to isolate … Continue reading 

| 19 Comments

An Observation Of Pair Programming vs. Not

I’ve spent the better part of the last month doing remote pair programming with Joey Beninghove, on our current contract. It’s been great – the constant discussion, the driving out of features, one small step at a time, the realizations … Continue reading 

| 42 Comments

Cost vs. Risk In Testing

There was a bit of interesting discussion on twitter this morning, concerning the cost of test-first vs. risk. Here’s the visual version of what I’m saying: The premise behind the value of test-first is that we will wash out (or … Continue reading 

| 12 Comments

A Few Thoughts On IoC, An Idea For A different Type Of Container, And A Lot Of Questions

With all the comments on my previous post, there actually is a lot of great insight to be had. I’ve picked up on a few underlying themes and several of the commenters were able to cut through the cruft of … Continue reading 

| 28 Comments

The Dangers Of AutoMocking Containers

Louis Salin commented on my original post about the Ninject.RhinoMocks automocking container, and brought up a very good point. Here is his comment, reproduced in full: I’ve heard (or read…) that automocking is equivalent to taking weight loss pills while … Continue reading 

| 5 Comments