Published: August 18, 2022 • Updated: March 21, 2023 • 2 min read
When testing user input or data presentation, I prefer using realistic rather than random data. For a recipes app, that would mean adding an ingredient called “Carrot” instead of “asdf.”
This might sound like something everyone agrees on and does, but in practice, it is not.
The behavior I’m describing: when testing forms, data presentation, or even seeding data, a programmer will enter keyboard-smashing gibberish or insider-y jargon.
An example might be an address form, where the programmer types some combination of the letters ‘asdf’ for each field. In this case, I think it’s better to enter ‘123 Milwaukee Ave.’ or similar into the first address field, ‘Chicago’ in the city field, and so on.
Or in a CMS field, where the programmer might type ‘Jake Testing The Header’ into the default field. In this case, I think it’s better to put ‘Dashboard’ or ‘Welcome!’ there.
Or in database seed data, where every customer’s email is ‘firstname.lastname@example.org’. Here, a series of automatically generated realistic emails makes the data easier to work with and talk about.
Who cares? Why does this matter? It matters because realistic data stresses the software in realistic ways, is easier to work with, and presents a more polished environment to whoever might be looking.
Real data stresses the software realistically.
Perhaps your template doesn’t display gibberish well. You entered a three-character email address into the form, and now the account page looks broken. Is that worth solving? Probably not. It’s a condition a customer will never experience. But by entering the bad data, you’re considering it.
Real data is more pleasant to work with.
I prefer to look at a website, even in development, with data that looks real. It helps me understand and empathize with my users.
Lastly, real data feels polished.
I share a lot of screenshots with my team. I prefer that those images, and those of my teammates, look real rather than displaying keyboard smashes and stream-of-consciousness nonsense. You never know where a screenshot from your dev environment might end up.
The counterargument is that it takes a little more time to think of something realistic to type. I think that tiny amount of time is always worth it. You get better at it.
One more point: many times I’ve seen a bug report with a title like “The header on the homepage is broken” and the root cause was a person replacing a header value in a CMS with “asdf.” Prefer real data.
Get better at programming by learning with me. Subscribe to my newsletter for weekly ideas, creations, and curated resources from across the world of programming.