Suggest a tool

factory_bot

Metrics as of , from the GitHub or GitLab API of each repository. Refreshed monthly.

What factory_bot is

factory_bot is a Ruby library that replaces fixtures with factory definitions for building test objects. Its build strategies return persisted objects, unsaved objects, stubbed objects or plain attribute hashes. One class can have several factories, such as user and admin_user. Factories can inherit from other factories. Rails projects use the separate factory_bot_rails gem. Integrations with RSpec, Rails and other libraries are covered in the project wiki. The gem is added to a project with Bundler or installed with the gem command.

Written from the project's README, read .

Category
Test data and mocking
License
MIT
Language
Ruby
Changelog
Releases on GitHub

Repository metrics

Repository metrics
Stars8,1691
Forks2,5551
Open issues and PRs831
Contributors3091
Commits in the last 90 days41
Last commit2026-08-211
Last releasev6.6.0, 2026-05-041
Fetched

1 Fetched from the GitHub or GitLab API on . Hover a value for its own date.

Status

activeLast commit within 90 days of the fetch date.

Computed from the last commit date and the archive flag on the fetch date. See the status rules.

Alternatives

Listed test data and mocking tools, same primary language first, then by GitHub stars. Each line gives one fact from the tool's documentation where it differs from factory_bot's, with its source.

How to install

bundle add factory_bot
From README, read .

Questions

Is factory_bot open source?

Yes. factory_bot is released under MIT, an OSI-approved license, as reported by the GitHub API on 2026-09-22.

Is factory_bot maintained?

On 2026-09-22, the last commit to the default branch was on 2026-08-21, so the listed status is active. Rule: Last commit within 90 days of the fetch date.

How many GitHub stars does factory_bot have?

8,169 stars on 2026-09-22, from the GitHub API. The number is refreshed at each monthly update.

What language is factory_bot written in?

The repository's primary language, as reported by the GitHub API, is Ruby.

How do I install factory_bot?

The README gives this command: bundle add factory_bot

Sources

  1. GitHub REST API: repository, read
  2. GitHub REST API: commits, read
  3. GitHub REST API: latest release, read
  4. GitHub REST API: contributors, read
  5. README, read