
Generating Realistic Test Data: Why Lorem Ipsum Is Not Enough
Every developer needs test data. Filling a database with "test test test" and " asdf@asdf.com " creates data that is nothing like production, which means your tests are nothing like production. Realistic dummy data catches bugs that toy data misses. I have found bugs in production that would have been caught in development if we had tested with realistic data: names with apostrophes breaking SQL, addresses too long for the column, phone numbers in unexpected formats, and email addresses with plus signs causing validation failures. What realistic test data looks like Realistic test data has the same statistical properties as real data: Names : Varying lengths, multiple cultural origins, special characters (O'Brien, Martinez-Lopez, Bjork), prefixes and suffixes (Dr., Jr., III). Emails : Different providers, varying username formats, subaddressing ( user+tag@gmail.com ), long domain names, international domains. Addresses : Real street patterns, varying line lengths, apartment numbers, in
Continue reading on Dev.to JavaScript
Opens in a new tab




