How do you add fake data to your apps for testing?

If you’re testing your web app, you’ll want to ensure you’re doing your tests with real content. I’ve come across a number of tools that help with this, giving you some form of “mock” app data to ensure you have as realistic an experience as possible when testing.

Of course, you could just add data manually, but that’s tedious work that should certainly be automated. Here are some tools/services that could help you out, depending on what you’re building:

generatedata.com - An “open source tool written in JavaScript, PHP and MySQL that lets you quickly generate large volumes of custom data in a variety of formats.”
Jsonstub - “Fake the backend while you develop the frontend.”
casual - Generate fake addresses, countries, cities, zip codes, and loads of other stuff with JavaScript.
fake-identity.js - “Generate random identity objects including name, address, etc.”
fake2db - “Create test databases that are populated with fake data.”
Chance.js - “A minimalist generator of random strings, numbers, etc. to help reduce some monotony particularly while writing automated tests.”

As you can see, there are lots of options to automate fake data. If you’ve built something similar, or know of another similar tool, feel free to share.

This editorial appears in this week’s issue of the SitePoint Newsletter.

Well the tool I’ve been using is Faker - which I found about from SitePoint! See this article http://www.sitepoint.com/simplifying-test-data-generation-with-faker/

1 Like

Here’s another one I came across, a Chrome extension for injecting mock data into Cordova apps:

https://chrome.google.com/webstore/detail/cordova-mocks/iigcccneenmnplhhfhaeahiofeeeifpn

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.