aj-geddes avatar

Test Data Generation

Solid foundation for generating test data without hardcoding values everywhere. Covers the main approaches: factories with overrides for simple cases, builders for complex nested objects, fixtures for integration test setup, and faker libraries for realistic looking data. The examples show JavaScript but the patterns translate directly to other languages. Most useful when you're tired of maintaining brittle test data across dozens of test files or need to spin up varied test scenarios quickly. The factory pattern guide is the strongest part, though I wish there were more examples of handling relational data and unique constraints. Worth using if you're past the "just inline some objects" phase of testing.

skills.sh installs
502
GitHub stars
379
last updated
Aug 21, 2026

Install

$ npx -y skills add aj-geddes/useful-ai-prompts --skill test-data-generation --agent claude-code

Installs into .claude/skills of the current project.

Files

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");

Sponsors

Details

Repository
github.com/aj-geddes/useful-ai-prompts
Categories
Testing & QA, AI & Agent Building
First seen
Jun 3, 2026

More from aj-geddes/useful-ai-prompts

All 258
1garrytan avatarqagarrytan/gstackSystematically QA test a web application and fix bugs found. (gstack)486skills.sh installs
2aj-geddes avatarmutation-testingaj-geddes/useful-ai-promptsEvaluate test suite quality by introducing code mutations and verifying tests catch them. Use for mutation testing, test quality, mutant detection, Stryker, PIT478skills.sh installs
3parcadei avatartddparcadei/continuous-claude-v3Test-driven development workflow with philosophy guide - plan → write tests → implement → validate472skills.sh installs
4secondsky avatartest-quality-analysissecondsky/claude-skillsDetect test smells, overmocking, flaky tests, and coverage issues. Analyze test effectiveness, maintainability, and reliability. Use when reviewing tests or imp469skills.sh installs
5laurigates avatarpython-testinglaurigates/claude-pluginsPython testing with pytest, coverage, fixtures, and mocking. Use when the user mentions pytest, unit tests, coverage, fixtures, mocking, or writing Python tests463skills.sh installs
6aj-geddes avatarcontinuous-testingaj-geddes/useful-ai-promptsIntegrate automated testing into CI/CD pipelines for continuous quality feedback. Use for continuous testing, CI testing, automated testing pipelines, test orch441skills.sh installs