
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-codeInstalls 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- Application Logging501
- Grafana Dashboard501
- Changelog Maintenance500
- Code Documentation500
- Api Reference Documentation499
- Database Performance Debugging499
- Reactive Programming496
- Api Pagination495
- Container Debugging494
- Nosql Database Design492
- User Persona Creation492
- Database Indexing Strategy491
- Api Response Optimization490
- Uptime Monitoring490
- Background Job Processing488
- Accessibility Compliance487
- Git Workflow Strategy487
- Web Performance Optimization487
- Zero Trust Architecture487
- Frontend State Management485
- Cross Platform Compatibility484
- Incident Response Plan484
- Dns Management483
- File Upload Handling483