Creating CSV test files using Mockaroo


Because of my dive-planning-slate project which can be used to calculate required gases/tanks for a predefined dive, I was in need for CSV files which store a bunch of dive steps. These dive steps are basically triples built from a depth, a duration and the related gas during this step. An example basic dive step triple looks like this (20,15,N21) while a decompression triple looks like this (6,10,N99).

Now, there are two ways to create these files:

  1. Manually create each one of them
  2. Use a tool to create them

At this point, I know exactly that you know, what I was doing 🤯. Of course, because I was lazy as f***, I was looking for a nice tool which may generate what I want without me typing countless entries like a monkey. But I did not expect a solution as the one I found. And the solution is called Mockaroo. This website is the absolute one-punch-man when it comes to CSV generation. For my use case, I entered these settings:

In addition, I selected 20 rows and removed the check from the header checkbox to prevent the field names being displayed in the CSV and clicked on preview. The result is quite nice:

But why do you write a blog entry about such basic CSV files? Because Mockaroo is able to create much more complex combination and also allows the creation of invalid entries in which values are missing. It also allows the the generation of random email addresses and so much more. After playing around a bit, I created a list of 1000 entries in the following format:

If I need to create other CSV files for testing purposes, this will be where I would look first!