Rails apps tend to start simple, with clean models and controllers. Then you start adding features. Before you know it, your models and controllers are big, unwieldy, and hard to understand. Refactoring into service objects is a great way to split these big pieces up, so they're easier to understand.
When you look at a Factory Bot factory definition, the syntax might look somewhat mysterious. The goal of this tutorial is to demystify the syntax. The way we’ll do this is to write our own implementation of Factory Bot from scratch.
There is a mental framework that has worked well for me across different teams, codebases and systems. I categorize technical debt in 3 buckets: code, data, and architecture. Let’s go over them now with some examples.