A Simple Way to Generate Test Data

Good test data is as realistic as possible but isn’t from production. Leaks can happen on test systems as well and they are often less protected as production systems. Whenever you need test data you can start creating it from scratch or write a tool. Both options take time and effort. However, there is a third option: test data generators. Today we look how you can create realistic test data without much effort.

Generatedata.com is the site I use whenever I need to generate test data. They started 10 years ago with a small script that continuously grows and offers now a web site where you can create your data. The user interface is simple and you can start without registration.

Generatedata data set definition

You can add columns, give them a title and select what type of data you want. The data types are the place where the magic happens. You can select different categories of names, numbers, email addresses, locations and many more:

Your fields combined with the selected type will be used to generate the test data. But having the data on this page doesn’t help you much. You need to get it into your application. The last part of the page offers you a big range of formats to export your freshly generated data:

The SQL tab lets you configure how your SQL scripts should be generated. That starts with the database you have, continue with the table name and ends up with creating an identity column. It currently supports SQL Server, MySQL, Postgres, SQLite and Oracle. If you prefer a different format you only have to choose a different tab.

The web site lets you only create 100 rows at a time. If you need more you can download the application and run it on your own system. It’s licensed under GPLv3 and can be forked from its GitHub page.

 

Conclusion

A site like generatedata.com is a great help to create realistic test data. You could write your own generator, but that can take hours. Why not try this one instead? Please leave a comment if you know other sites that work so well.

1 thought on “A Simple Way to Generate Test Data”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.