Sep 14

Test Data Generator

Tag: TechnologyJosh @ 11:01 pm

I frequently have the need to enter fake data when developing/testing an application.  Things like names, addresses, credit cards, etc. To assist with this, I’ve been working on an application to easily produce test data.

Currently, it generates the following:

  • Full Name (First, Middle, and Last.  First and Middle names are for same gender, though the gender is randomly chosen)
  • Address (Street Address, City, State, Zip, County)
  • Phone Number
  • Credit Card (Type, Number, Expiration)
  • Bank Account (Bank Name, Account Type, Routing #, Account #)
  • Date of Birth
  • Driver’s License (Number, State, Expiration)
  • SSN
  • Email Address
  • URL
  • Company Name

It can generate any of the above items individually, or you can generate a “Person” with all of these data elements included.  If generating a person, the email address will contain the person’s first name, with the domain matching the company’s name.  The area code of the phone number will be correct for the City/State of the address.  The State for the Driver’s License will also match the person’s state.

The credit card and banking numbers will also pass basic validation algorithms (luhn/mod10).

I should note that this is similar to what can be found at http://www.fakenamegenerator.com, which I discovered after I started working on this project. The difference is my solution is more robust, and can be used programmatically instead of having to visit the website.

Currently, this is only a basic PHP class that can be called to generate the data.  The next step is to expose the methods as a Soap Web Service (so it can be used by any programming language).  I’ll also build a GUI front-end that will allow download of the generated data in a delimited format.

When I originally wrote this, I intended to use it for work.  However, I’ve written it completely from home, and I’d like to keep it for my own and license it under LGPL.  I’ll still use it for work, but I want it to be “my” project and not my company’s.  Of course, I remember something from the paperwork I signed when I started working here about my employer owning any thoughts I have during my employment.  It is for this reason that I’ve tried really hard not to have any thoughts for the past 3.5 years.

I figure I’ve given them enough of my soul already.  Surely they’ll let me keep this one small thing?

Share/Save/Bookmark

Leave a Reply