thoughtbot/factory_bot
A library for setting up Ruby objects as test data. observed · 2026-08-28
Health v2 · maintenance only
89/100
- Activity 98
- Release rhythm 70
- Longevity 100
How is this computed?
round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.
- gap_med: 70
- age_days: 6665
- days_rel: 121
- days_push: 12
- n_releases_24m: 8
Adoption not part of the score
8169 stars · 2552 forks observed · 2026-08-28
What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-29, confidence not recorded
factory_bot is a Ruby library for defining and building test data objects with a straightforward factory definition syntax. It supports multiple build strategies (saved instances, unsaved instances, attribute hashes, stubbed objects), multiple factories per class, and factory inheritance, serving as a fixtures replacement.
Use cases
- generate test data for ruby tests
- replace rails fixtures with factories
- create test objects with associations in rspec
- define reusable factories with traits and inheritance
- set up test records for rails integration tests
- stub objects in unit tests without hitting the database
When to choose
- you write Ruby or Rails tests and need flexible, maintainable test data setup
- you want a fixtures replacement with build strategies like stubs and unsaved instances
- you need factory inheritance, traits, and multiple factories per class
- you use RSpec, Minitest, or Rails test suites
When to avoid
- you are not working in Ruby or a Ruby-based framework
- you prefer plain fixtures, seeds, or hand-rolled test data builders
- you need test data generation for non-Ruby languages
Facets
library · maturity stable
testing mocking data-generation testing web-development developer-tools ruby jvm fixtures-replacement test-data factories rails rspec factory-girl
5 sources
- readme: https://github.com/thoughtbot/factory_bot · fetched 2026-08-28 · 5e993b34586c
- homepage: https://thoughtbot.com · fetched 2026-08-29 · 5510254df796
- site_page: https://thoughtbot.com/case-studies/closeknit-health · fetched 2026-08-29 · ec773542ed58
- site_page: https://thoughtbot.com/services · fetched 2026-08-29 · 5b152b8c27da
- site_page: https://thoughtbot.com/our-company · fetched 2026-08-29 · 9e2e18b981fb
Member repositories
| Repository | Role | Health v2 |
|---|---|---|
| thoughtbot/factory_bot | main | 89 |
For agents
markdown · JSON · MCP: product_card(name="thoughtbot/factory_bot")
Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem