3 ms·
> How would you have prevented this defect instead, in a way that you find simple? I currently prevent this sort of thing using a populated database. This data
by lelanthran 2y ago
> How would you have prevented this defect instead, in a way that you find simple?
I currently prevent this sort of thing using a populated database. This database has actual real data (user info overwritten with random data).
Using a pre-populated database catches many more errors than this article's approach does.
Using a pre-populated database that has actual data generated by the users over a year or so catches even more errors.
This approach is fragile and misses the actual error, fixing only the symptom. The actual error is "there's a hole in my tests big enough to fly a passenger jet through".
The correct approach is to take a dump of the production database, scrub PII from it, and then perform your migration.