0

A quick one, I am looking for a tool for data generation. I have an entity with dates; the date it was made, a start date and an end date. I want the data generation to take care of this constraints:

  1. made maybe today or some day after
  2. start maybe equal to made but not before
  3. end maybe only be a day after start or any other date after start

I looked at http://generatedata.com and http://mockaroo.com, but they didn't have a way i could maintain the constraints. I just need that constraint, but not sure which softwares to try to maintain these constraints. I just need quick data to test my application. thanks

and just a by and by, have you ever been in such a situation where what you need you can't find?

Obby
  • 1,353
  • 2
  • 13
  • 20
  • You should write the data generation tool yourself. It's really not that hard for your requirements. Pick a language like Ruby, Groovy or Python that are easy/fun to work with. It's a good skill to develop because I'm sure it'll come up again in the future. – ryan1234 Mar 28 '13 at 01:43
  • @ryan1234, I need quick data...i may write one but it will take time. – Obby Mar 28 '13 at 16:31
  • Take a look at my [TestDataGenerator](https://github.com/SecretDeveloper/TestDataGenerator) project on Github and see if it can do what you need. It uses a regular expression like syntax to generate data. You could create a template file and add placeholders with patterns to produce the output you want. – SecretDeveloper Sep 02 '14 at 15:10
  • i'll check it out @SecretDeveloper – Obby Oct 08 '14 at 08:36

1 Answers1

0

benerator is the tool to use, which is is very flexible though one needs to learn it pretty fast. with my above situation, in the xml file for benerator (that's what it uses ), i just write the following and i'm good to go. in fact, i can even now put ranges for made, start and end dates. This is a section of a generate tag for 30 records of an entity (let's call it MY_ENTITY) with those dates

<import class="org.databene.commons.TimeUtil"/>

<generate name="MY_ENTITY" count="30" consumer="ENTITY_OUT">
    <attribute name="MADE_DATE" type="date" script ="TimeUtil.today()" />
    <variable name= "for_startDate" type="int" min="0" max="10" />
    <attribute name="START_DATE" type="date" script="TimeUtil.addDays(this.MADE_DATE, 
         for_startDate)" nullable="false"/>
    <variable name="for_endDate" type="int" min="1" max="10" />
    <attribute name="END_DATE" type = "date" script="TimeUtil.addDays(this.START_DATE, 
         for_endDate)"  nullable="false"/>
</generate>

and benerator supports many databases through JDBC, and it comes loaded with several JDBC drivers. try it here http://bergmann-it.de/test-software/index.php?lang=en. it's open source

Obby
  • 1,353
  • 2
  • 13
  • 20