Generate random test data

Date August 16, 2007

I put together a small utility to generate random user data several months back. I realized yesterday that I hadn’t released the source code – I thought I had. This generates plausible names, addresses, phone numbers and social security numbers. The phone number area codes don’t generally match up with the address, but the addresses are accurate in that the city/state/zip all match. The addresses are currently US-based only. The code will also generate SQL statements for you to insert directly in to your database if selected.

Have a look at the code in action over at http://www.fosterburgess.com/v2/random.php and click the ‘download source code’ link at the bottom to grab you a copy. If you have any enhancements to share, feel free to send them back and I’ll add them in.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • TailRank
  • YahooMyWeb
  • del.icio.us
  • DZone
  • Facebook
  • Reddit
  • StumbleUpon
  • Digg
  • Simpy
  • Technorati

4 Responses to “Generate random test data”

  1. gareth_heyes said:

    Excellent work! Thanks for the code, this shall be very handy for some work I’m doing cheers

  2. PHPDeveloper.org said:

    Michael Kimsal’s Blog: Generate random test data…

  3. developercast.com » Michael Kimsal’s Blog: Generate random test data said:

    [...] Kimsal points out a small utility to create information he found himself needing over and over – information that [...]

  4. Dave said:

    Cheers for this , excellent for testing the multiple databases we are learning to build :)

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">