Barrison Twitter

Rails is killing TDD

On last week's Turing-Incomplete, I proposed the topic Why Rails is Awesome/Terrible. Our conversation was so spirited, I never did get into the most important thing about Rails - how it's killing TDD.

Making a Rails application today involves little programming. The Rails ecosystem is so rich that there are gems for nearly every problem you need to solve.

Authentication/OAuth? Add a gem. Configure.

Pagination? Add a gem. Configure.

Comments? Add a gem. Configure.

Coding Rails

This is actually great. I don't want to waste time reinventing the wheel.

However, I think we're creating an entire generation of Rails developers who don't understand TDD.

While testing is generally accepted, even expected in the Ruby community, we've forgetten what TDD is and why we are even testing.

"TDD" is not a synonym for "writing some tests." TDD stands for Test Driven Design (or Test Driven Development).

Or, as Uncle Bob says:

“The act of writing a unit test is more an act of design than of verification. It is also more an act of documentation than of verification. The act of writing a unit test closes a remarkable number of feedback loops, the least of which is the one pertaining to verification of function”.

But today, in many apps, there are increasingly fewer places where design decisions need to be made or documented.

So instead, we argue about writing tests that prove correctness and that often leads to large, slow, brittle test suites that do not help the quality of our code.

And when the time does comes in an application's life when the Rails default patterns are no longer sufficient, a team has neither the expertise nor the infrastructure to test drive a different design.

For further reading about test-driving designs:

Growing Object-Oriented Software Guided by Tests - Steve Freeman


Manipulate History for Meaningful Commits

Quantum leap

One of git's most powerful features is the ability to rewrite history.

While developing, I commit after every step of the red-green-refactor cycle. I prepend them with the word 'wip' as a reminder not to share them with the world.

 ~/code/paleospots...

Slides and Links from my talks at MADEXPO

Thanks for everyone who came to my sessions at MADExpo!

If you came for JavaScript is Real Code, here’s my previous post containg slides and code.

If you came for Getting Git, here’re my slides:

Getting Git (pdf)

And some links containing topics...


Upcoming Speaking Engagements

I'll be giving talks on Modern JQuery and Git at TechBash (April 28th)

I'll be speaking on CoffeeScript and Backbone.js at:


Random Git Goodness

git add -p

Interactively stage files.

The best part about this command is that you can add, not add or split a hunk.  I've started using this command constantly to double check the modifications I've made and it's ridiculous how often I would otherwise...