Developer's Diary
Software development, with Terry Ebdon
|
I've been working on a Grails web app. The app needs to hold user information for adults and children.
Obviously I need some test data, and a decent amount of it. I used randat.com to create the initial dataset, but that was trickier than I expected. The site can't generate dates. It can handle ages, but only for adults. I selected the youngest available age range and ran with this configuration:
I thought that would be good enough, with some Bootstrap.groovy code to handle the age to date conversion. The down-loaded CSV file has unnecessary double quotes, and the email addresses use randatmail.com
. I fixed both issues with a global replace, in VS Code, to give a file like this:
The file has a fatal flaw, RANDAT has allocated the same email address to several users. The final Boostrap code has to infer the date of birth and generate a new email address. In retrospect I should have used RANDAT for just the name fields and added everything else myself, it would have been faster and simpler.
The user table has to include children to test the app. Four years is subtracted from the age to force some kids into the dataset. The final ages will be in the range 14 to 26.
03-JUN-2020 👈 Top of page 👉 11-JUN-2020
© 2020 Terry Ebdon.
Find me coding on GitHub, networking on LinkedIn, answering questions on Stack Exchange and hanging out on twitter.