I've been thinking a lot about one of the oldest discussions we've had as Rails developers: factories or fixtures?

At some point, I think we reached a consensus. Factories are easy for devs to manage. They're familiar and simple, and that's good. But they have a lot of problems, especially with deep nesting. Factories get slower and slower if people aren't careful, and let's just admit it, people very often aren't.

Fixtures have always been annoying to manage. They're written in a very data-heavy way, so they read more like data than objects. That brings its own problems, and they're annoying to write. But fixtures have always been super fast to run.

In a world where AI exists, I think fixtures now have such a massive edge over factories that it's not even fair anymore. The annoying part of dealing with fixtures is gone. You can just outsource it to AI.

That's what I've been doing at my current job. I've been going through specs that spend pretty much 90% of their time in factories and changing them to fixtures.

And then with very little cost those specs got generally 10x faster, sometimes even more. 8x is a certainty. 15x on a nice case.

And most of this has been me telling an AI, "Just rewrite this shit with fixtures." Goodbye.

It's such a massive win for a really low cost. More devs should be doing this.