back

Fixture drama - in case you missed it

A long time ago Francis Hwang gave a presentation on ‘testing heresies’

One of his points was that he had experienced lots of bad things when trying to use fixtures, despite the fact that people encouraged you to use them.

Then recently Josh posted about how there are lots of choices when we setup new rails apps these days

In the comments, Francis reiterated his point.

DHH disagreed

Then Francis further explained

His main point was that using YAML to explain data is harder to learn / harder to do than just using Ruby.

Then Rick Olsen weighed in

Then Francis weighed in again

There are probably a few other posts that I’m missing.

At any rate, It doesn’t surprise me that people care about this stuff this much. Rails folks have to spend a decent amount of time every day testing, and maintaining tests. So, if you’ve found a way that you think is best you kind of have to evangelize it b/c you want to save everyone else pain.

It also doesn’t surprise me that fixtures work fine for dhh with basecamp etc.

But in general I’ve found that machinist is by far easier to deal with than fixtures. It not only sets up associations, but also works well with Faker to add in data.

On Francis Hwang’s point about making testing easy for new people, I tend to agree that fixtures are a net negative, as they were in my case. It’s super easy to create a fixture mess for yourself. On the other hand, it’s super easy to create an RSpec mess for yourself, so who knows.

As always, I think the solution is more cucumber.

February 11, 2009