🏭

Test Data Factory

Verified

by Community

Builds test data factories and builders for generating consistent, realistic test data. Supports factory patterns with traits, sequences, associations, and overrides for flexible test data creation across your test suite.

testdatafactoryfixturestestingqa

Test Data Factory

Create test data factories for generating consistent, realistic test data with flexible overrides and associations.

Usage

Describe your data models and this skill will create factory functions for test data generation.

Examples

  • "Create a factory for generating test user data with optional overrides"
  • "Build factories with associations between orders, products, and users"
  • "Generate realistic test data with Faker for my e-commerce models"

Guidelines

  • Use sensible defaults that produce valid objects without overrides
  • Support trait variations for common test scenarios
  • Use sequences for unique values like emails and usernames
  • Create associated records lazily to avoid unnecessary database writes
  • Keep factories close to the models they represent