How to Generate Test Data (Mock & Dummy Data)
Test data lets you build and check software without real user records. Learn what makes good mock data and how to generate ids, numbers and filler fast.
Test data — also called mock or dummy data — is realistic-looking but fake information used to develop and test software without touching real user records. Good test data covers the shapes and edge cases your code must handle.
What good test data includes
- Unique ids — UUIDs or ULIDs for primary keys, so rows do not collide
- Realistic ranges — ages, prices and dates within believable bounds
- Edge cases — empty strings, very long text, zero, negatives and special characters
- Enough volume — sometimes thousands of rows to test pagination and performance
Why not use real data?
Real user data carries privacy and legal risk, and may be uneven. Synthetic data is safe to share, easy to reset and can be shaped to hit the exact cases you want to test.
Generate the pieces
- Unique keys with the UUID generator
- Random values and quantities with the random number generator
- Filler paragraphs with the Lorem Ipsum generator
Related: UUID v4 vs v7 vs ULID.