views:

99

answers:

4

Sometimes you need data for tests, like Adobe Thermo has prewritten "sets" of data, like 1-word strings, 3-word strings, etc for use in populating data controls.

I need:

  • Continuous text, no newlines
  • CSV Numbers, Integers
  • CSV Numbers, Decimals
  • URL encoded strings

Any ideas on how to get any of those?

+1  A: 

Generate them? A quick perl script can generate huge sets of data.

Part of the challenge with CSV is all the edge cases (awkward standard-use of newlines, which does not exactly match how Excel or SQL Server parse CSVs). I've had to build those by hand in the past.

Can perl be run client-side?
Jenko
Yup..it's a programming language, like any other.
+1  A: 

Continuous text, no newlines

Download a few files from Project Gutenberg and run sed on it to replace newlines by whitespace.

CSV Numbers, Integers

Google/Y! finance AFAIK allows you to download historical stock quotes. That'd be a nice start. But they are usually a mixture of string(stock name), date and 4 different floating values and one integral volume value.

dirkgently
+1  A: 

I simply made (in VB.NET) a helper class to generate random strings of a length in a specified range, or random numbers. I did this when first trying unit testing within Visual Studio. So, for example, when I wanted to test Customer.Create, I would set up a loop to run 1000 times to create 1000 customers with all kinds of random values. For example,

(pseudo-real-code)

For x = 1 to 1000
    Dim c as New Customer
    c.Name = Helpers.GetRandomString([minLenth], [maxLength])
    c.Address1 = Helpers.GetRandomString([minLenth], [maxLength])
    c.Telephone = Helpers.GetRandomPhoneNumber()
    ...
Next
HardCode
+1  A: 

GenerateData.com is a free, open source script written in JavaScript, PHP and MySQL that lets you quickly generate large volumes of custom data in a variety of formats for use in testing software, populating databases.

  • JS-enabled and browser-friendly.
  • Many data types: names, phone numbers, email addresses, cities, states, provinces, counties, dates, street addresses, number ranges, alphanumeric strings, lorem ipsum text and more.
  • Option to generate data in XML, Excel, HTML, CSV or SQL.
  • Country specific data (state / province / county) for Canada, US, Netherlands and UK.
  • Saves your data generation forms for later use
Jenko