At least 1 seed data script exists for development and testing
Why it matters
Without a seed script, every prisma migrate reset during development requires manual recreation of test accounts, sample data, and edge-case records. New developers spend hours setting up a usable dev environment instead of writing code. More critically, automated tests that depend on database state cannot run reproducibly in CI without seed data, leading to test infrastructure that is too fragile to run in automated pipelines. ISO 25010 testability requires that the system can be placed into a known state for testing; a seed script is the minimal mechanism for achieving this.
Severity rationale
Low because missing seed data degrades developer productivity and test reliability without causing runtime failures in production.
Remediation
Create prisma/seed.ts (or equivalent for your ORM) with synthetic data using @faker-js/faker and register it in package.json. Use bcrypt-hashed placeholder passwords, never real credentials.
// prisma/seed.ts
import { PrismaClient } from '@prisma/client'
import { faker } from '@faker-js/faker'
const prisma = new PrismaClient()
async function main() {
for (let i = 0; i < 10; i++) {
const user = await prisma.user.create({
data: { email: faker.internet.email(), name: faker.person.fullName() }
})
await prisma.post.createMany({
data: Array.from({ length: 3 }).map(() => ({
title: faker.lorem.sentence(), userId: user.id
}))
})
}
}
main().finally(() => prisma.$disconnect())
// package.json
{ "prisma": { "seed": "npx ts-node prisma/seed.ts" } }
Run with npx prisma db seed. For CI, include this after prisma migrate deploy in the test setup step.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Database Design & Operations Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- iso-25010:2011 · maintainability.testability — Testability
Taxons
History
- 2026-04-18·v1.0.0·Initial import from database-design-operations·automated