mcpField
T
test-data-generation

test-data-generation

github.com/aj-geddesTesting & quality373498 installsUpdated 34w ago
Repository

About test-data-generation

A skill for generating realistic, consistent test data for automated testing and development. It supports reusable factories, fixtures, builders, and varied scenarios, including edge cases and related data.

Key features

  1. 01Reusable data factories
  2. 02Builders for complex objects
  3. 03Fixtures for integration tests
  4. 04Realistic and unique values
  5. 05Edge-case and boundary data

Use cases

  1. 01Creating integration-test fixtures
  2. 02Seeding development databases
  3. 03Generating related test records
  4. 04Testing boundary values and unusual inputs

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill test-data-generation

After installing, type/test-data-generationin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
builder-pattern-for-complex-objects.md
factory-pattern-for-test-data.md
fixtures-for-integration-tests.md
realistic-data-generation.md
scripts/
scaffold-tests.sh
templates/
test-template.js

Details

From the project README

Test Data Generation

Table of Contents

Overview

Test data generation creates realistic, consistent, and maintainable test data for automated testing. Well-designed test data reduces test brittleness, improves readability, and makes it easier to create diverse test scenarios.

When to Use

  • Creating fixtures for integration tests
  • Generating fake data for development databases
  • Building test data with complex relationships
  • Creating realistic user inputs for testing
  • Seeding test databases
  • Generating edge cases and boundary values
  • Building reusable test data factories

Quick Start

Minimal working example:

// tests/factories/userFactory.js
const { faker } = require("@faker-js/faker");

class UserFactory {
  static build(overrides = {}) {
    return {
      id: faker.string.uuid(),
      email: faker.internet.email(),
      firstName: faker.person.firstName(),
      lastName: faker.person.lastName(),
      age: faker.number.int({ min: 18, max: 80 }),
      phone: faker.phone.number(),
      address: {
        street: faker.location.streetAddress(),
        city: faker.location.city(),
        state: faker.location.state(),
        zip: faker.location.zipCode(),
        country: "USA",
      },
      role: "user",
      isActive: true,
      createdAt: faker.date.past(),
      ...overrides,
    };
  }
// ... (see reference guides for full implementation)

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
Factory Pattern for Test DataFactory Pattern for Test Data
Builder Pattern for Complex ObjectsBuilder Pattern for Complex Objects
Fixtures for Integration TestsFixtures for Integration Tests
Realistic Data GenerationRealistic Data Generation

Best Practices

✅ DO
  • Use faker libraries for realistic data
  • Create reusable factories for common objects
  • Make factories flexible with overrides
  • Generate unique values where needed (emails, IDs)
  • Use builders for complex object construction
  • Create fixtures for integration test setup
  • Generate edge cases (empty strings, nulls, boundaries)
  • Keep test data deterministic when possible
❌ DON'T
  • Hardcode test data in multiple places
  • Use production data in tests
  • Generate truly random data for reproducible tests
  • Create overly complex factory hierarchies
  • Ignore data relationships and constraints
  • Generate massive datasets for simple tests
  • Forget to clean up generated data
  • Use the same test data for all tests

Comments

Markdown supported