awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
thoughtbot avatar

thoughtbot/factory_bot

0
View on GitHub↗
8,176 stars·2,556 forks·Ruby·MIT·15 viewsthoughtbot.com↗

Factory Bot

FactoryBot is a Ruby library for generating complex test objects and their associations, serving as a dynamic alternative to static fixture files. It provides a system for defining reusable data blueprints with default attributes and inheritance to produce consistent test records.

The tool distinguishes itself through flexible instantiation strategies, allowing users to control whether objects are persisted to a database, built in memory, or created as stubs. It manages data uniqueness via a sequence generator for incremental values and uses traits to bundle shared attributes into reusable modules that can be mixed into objects during creation.

The project covers broad capability areas including automated object association management, bulk record generation, and lifecycle hooks for executing custom logic during the build process. It also includes utilities for validating factory definitions and tracking execution through instrumentation.

Features

  • Test Data Factories - Implements a comprehensive system for defining reusable data blueprints and factories to generate consistent test environments.
  • Test Data Blueprinting - Provides a system for creating reusable templates with default attributes and nested inheritance to reduce repetition.
  • Variant Definitions - Allows defining multiple factories for a single class and using inheritance to share common attributes across different roles.
  • Test Attribute Grouping - Bundles shared attributes into reusable traits to mix them into objects during instantiation.
  • Automated Association Generation - Automatically resolves and creates linked test objects based on class associations.
  • Automatic Association Linking - Links factories together to automatically create related objects through implicit naming and polymorphic relationships.
  • Test Object Associations - Automatically links related Ruby objects through implicit naming and polymorphic relationships during test data generation.
  • Persistence Strategies - Provides flexible strategies to control whether objects are persisted to a database, built in memory, or stubbed.
  • Blueprint Inheritance - Enables factories to inherit attributes from parent definitions to create specialized object variants.
  • Test Data Generators - Creates complex objects and their associations for testing to replace the need for static fixture files.
  • Attribute Traits - Bundles shared attributes into reusable traits that can be dynamically added to objects during instantiation.
  • Dynamic Object Instantiation - Provides a system for creating complex test objects from reusable blueprint definitions and hierarchical configurations.
  • Automated Test Data Generation - Creates flexible and reusable object blueprints to replace static fixture files in a testing environment.
  • Database Object Mocking - Produces persisted or in-memory Ruby objects with complex associations for use in automated test suites.
  • Test Instantiation Strategies - Provides flexible strategies to control whether test objects are persisted to a database, built in memory, or created as stubs.
  • Testing Object Emulation - Creates complex Ruby objects and their associations for testing as a dynamic alternative to static fixture files.
  • Test Sequence Generation - Produces incremental or cycling values for attributes to ensure data uniqueness across multiple test records.
  • Sequential Value Generation - Maintains internal counters to provide incremental or cycling values for attributes to prevent data duplication.
  • Dynamic Templates - Provides a simple syntax for creating dynamic blueprints that replace static fixtures with generated data.
  • Lifecycle Callbacks - Implements build and creation callbacks to execute custom setup logic at specific stages of the object lifecycle.
  • Alphanumeric Sequence Generation - Includes a sequence generator to produce incremental or cycling values, ensuring attribute uniqueness across test records.
  • Bulk Test Record Generation - Produces arrays of objects in bulk using list methods while allowing attribute overrides for individual items.
  • Composite Generation Strategies - Generates test objects using various strategies, including persisted instances and attribute hashes.
  • Test Data Isolation - Provides unique and consistent data records for tests to ensure isolation and prevent data collisions.

Star history

Star history chart for thoughtbot/factory_botStar history chart for thoughtbot/factory_bot

How this analysis was created: This summary and feature list were written by an AI model that read the project's README and public documentation pages. Each feature links to the documentation it came from; stars, license and language come straight from the GitHub API. The model does not read the source code, and the analysis is refreshed when the project is re-analysed. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Open-source alternatives to Factory Bot

Similar open-source projects, ranked by how many features they share with Factory Bot.
  • factoryboy/factory_boyFactoryBoy avatar

    FactoryBoy/factory_boy

    3,799View on GitHub↗

    Factory Boy is a dynamic test fixture framework and data generation tool for Python. It serves as a replacement for static fixtures by providing a system to create complex Python objects and database models through programmable blueprints. The project differentiates itself by offering specialized integration with Object Relational Mappers to manage persistence within database sessions. It enables the creation of complex object hierarchies using sub-factories and recursive composition to resolve dependent related objects. The framework provides capabilities for synthesizing realistic random d

    Pythondjangofixtureshacktoberfest
    View on GitHub↗3,799
  • nelmio/alicenelmio avatar

    nelmio/alice

    2,539View on GitHub↗

    Alice is a PHP test data generator and fixture library used to automate the creation of large sets of fake objects and entities. It functions as an object hydrator and random data provider, allowing users to define the structure and attributes of dummy test data in markup or arrays to simulate specific application states. The library distinguishes itself through a template-based system that supports fixture inheritance to reduce data duplication. It utilizes a flexible instantiation model that allows for custom factory integration, method invocation, and property hydration via reflection or c

    PHPaliceexpression-languagefaker
    View on GitHub↗2,539
  • thomhurst/tunitthomhurst avatar

    thomhurst/TUnit

    3,744View on GitHub↗

    TUnit is a comprehensive C# testing framework, mocking library, and fluent assertion tool. It utilizes source generation for test discovery and mock creation, ensuring compatibility with Native AOT and IL trimming by eliminating the need for runtime reflection and proxies. The framework provides specialized capabilities for integration testing, including the management of distributed application lifecycles, isolated database schemas, and the correlation of telemetry and logs across process boundaries via OTLP. It also includes an HTTP testing utility to intercept network exchanges and mock AP

    C#csharpdotnettest
    View on GitHub↗3,744
  • codeigniter4/codeigniter4codeigniter4 avatar

    codeigniter4/CodeIgniter4

    5,924View on GitHub↗

    CodeIgniter is a PHP web framework built on the Model-View-Controller pattern, designed for building full-stack web applications. It provides a lightweight toolkit with minimal configuration, organizing application logic into controllers, models, and views for clean separation of concerns. The framework includes a fluent query builder for constructing SQL statements programmatically, PSR-4 autoloading with namespace mapping, and a service-based dependency injection container for managing shared class instances. The framework distinguishes itself through its comprehensive set of built-in tools

    PHPcodeignitercodeigniter4framework-php
    View on GitHub↗5,924
See all 30 alternatives to Factory Bot→

Frequently asked questions

What does thoughtbot/factory_bot do?

FactoryBot is a Ruby library for generating complex test objects and their associations, serving as a dynamic alternative to static fixture files. It provides a system for defining reusable data blueprints with default attributes and inheritance to produce consistent test records.

What are the main features of thoughtbot/factory_bot?

The main features of thoughtbot/factory_bot are: Test Data Factories, Test Data Blueprinting, Variant Definitions, Test Attribute Grouping, Automated Association Generation, Automatic Association Linking, Test Object Associations, Persistence Strategies.

What are some open-source alternatives to thoughtbot/factory_bot?

Open-source alternatives to thoughtbot/factory_bot include: factoryboy/factory_boy — Factory Boy is a dynamic test fixture framework and data generation tool for Python. It serves as a replacement for… nelmio/alice — Alice is a PHP test data generator and fixture library used to automate the creation of large sets of fake objects and… thomhurst/tunit — TUnit is a comprehensive C# testing framework, mocking library, and fluent assertion tool. It utilizes source… codeigniter4/codeigniter4 — CodeIgniter is a PHP web framework built on the Model-View-Controller pattern, designed for building full-stack web… fzaninotto/faker — Faker is a PHP library for creating realistic synthetic data used for testing, prototyping, and populating database… hypothesisworks/hypothesis — Hypothesis is a Python property-based testing library and data generation engine. It enables the discovery of edge…