/* PHP & MySQL Journal */
One of the most time consuming steps in developing a database based application is test data generation. Imagine you have created a shopping cart application for your client, containing dozens of tables and hundreds of fields. Everything is ready for testing, but the problem is your database is empty. You at least require a modicum of test data in the database to proceed with the testing. You can choose to manually enter a small set of random data into the database, but you lose a couple of precious days in the process. What you require is a data generator that automatically generates test data for your database.
There are a couple of data generators available for free on the web, but they are only suitable if your database schema is small, with no more than three to four tables and total number of fields not exceeding a dozen or so. While browsing I came across Advanced Data Generator (ADG), a test data generator for MySQL. ADG allows you to generate a random test data for dates, URLS, E-mail addresses, cities, names, countries and more.
Once you connect ADG to your MySQL server and register a database, you are ready to go. Generating the test data is quite simple. First you create a project for your data generation work. Once done, you select the table and fields you want to generate data for, select the type of test data to generate – dates, urls, names etc. Set the total number of records to generate and then run the project. This will create the test data for your database project. The test data can be saved directly to the connected database or you can save it as a separate SQL script, YAML or CSV file. Below is a sample screenshot of a data generation project.
The Advanced Data Generator comes with a very useful repository of real-life like data, in order to generate meaningful test-data for the database. You can also use custom SQL scripts or Macros to generate custom string data.
Although not free, its a small price to pay for the excellent automation it provides during database creation.
|
|
This site is a digital habitat of Sameer, a freelance web developer working from Pune.More
2 Responses
1
uberVU - social comments
November 4th, 2009 at 7:48 pm
Social comments and analytics for this post…
This post was mentioned on Twitter by KamiSLO: Test data generation for MySQL - easily generate test data for your MySQL database http://bit.ly/LaGFq...
2
jozef
November 5th, 2009 at 8:11 am
I was looking for test data generator last week and my choice is Benerator. It doesn’t have standalone GUI but powerful XML config file with scripting language. http://databene.org/databene-benerator/tutorials/85-database-population-tutorial.html There is also a long list of similar products on their site. http://databene.org/databene-benerator/similar-products.html