Test data generation for MySQL


Posted in: data, mysql, testing | Save to del.icio.us | Twit This! 3 Nov 2009

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.

Data Generation

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.

adg1

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.

adg2

In closing

Although not free, its a small price to pay for the excellent automation it provides during database creation.




Share this post

Share on Facebook
Share on Twitter
Share on StumbleUpon
Share on Delicious
Share on Digg
Share on Technorati
Share on Reddit
Feeds RSS Subscribe to site Feed

Other related posts



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

Comment Form

Use the html <code> tag to insert small source code snippets

For longer code examples use http://pastie.org/.

Get latest updates by E-mail

About this blog

This site is a digital habitat of Sameer, a freelance web developer working from Pune.More

Recent Comments

  • Arjan: Fiddler is a debugging tool for IE (not Microsoft's Fiddler) [...]
  • Susan Martin: while creating a test for site, command icons on IDE greyed out and do not respond when selected. I [...]
  • Saar: Thanks for this example. helped me a lot. I have 1 problem, I am translating chunks of code, but I [...]
  • sameer: You can add extra GET variables in the options array as below: $pager_options = array( 'mode [...]
  • Martin: How can you carry over your own variables into the URL? I am using a form to POST a couple of var [...]
  • nancy: thanks very much ! first tools [...]
  • Krishna | PHP Programmer: Thanks for sharing !! [...]
  • Really Useful Tutorials You Should Have Read in February 2010 Ajax Help W3C Tag: [...] Reading Google Analytics data from PHP By Sameer Borate, February 1st, 2010 Site: Code Diesel [...]

  • Users Online

    • 13 Users Online
    • 12 Guests, 1 Bot