Day 065 / Testing / Synthetic Data

Test Data Factory

View source ↗Scroll to explore ↓
Test Data Factory project cover
/ Overview

A dependency-free Python CLI that generates repeatable, privacy-safe synthetic JSON records from a small declarative schema.

NameTest Data Factory

ClientIndependent daily build

IndustriesSoftware quality tooling

DateDay 065 · November 3, 2026

/ Challenge

Tests need representative records, but hand-written fixtures become repetitive and real production data creates privacy and security risk. Random output without a stable seed also makes failures harder to reproduce.

/ Provided services

Clear thinking.
Practical delivery.

01

Declarative schema

Each field declares a name, safe type and only the options that type needs, keeping fixtures compact and reviewable.

02

Deterministic batches

A local random generator initialized with the chosen seed makes failures reproducible across repeated runs.

03

Privacy-safe defaults

Synthetic labels and reserved example.test addresses avoid implying that generated records belong to real people.

Test Data Factory feature visual
/ Solution

Test Data Factory validates one bounded local schema and generates deterministic JSON or NDJSON records from a numeric seed. It supports bounded integers, booleans, declared choices, prefixed random strings and synthetic email addresses under the reserved example.test domain. The same schema, count and seed reproduce the same batch. Duplicate keys and field names, unknown options, invalid bounds, oversized schemas and batches above 1,000 records are rejected. It uses no real names, scraped data, credentials or production systems.

/ Impact

Repeatable seeded fixtures

Five bounded field types

JSON and NDJSON output

Reserved test email addresses

No production-data dependency

/ Tech stack

Python standard library

Argparse, JSON, random, regex, pathlib and unittest keep the CLI portable and dependency-free.

Bounded validation

The parser limits fields, choices, string lengths and record counts while rejecting duplicate and unknown input.

Twelve tests

Tests cover reproducibility, seed changes, field ordering, every supported type, privacy-safe email output and invalid schemas.

Next project

Visual Regression Manifest

View case study ↗