Over the years I used multiple tools to generate test data. Most the time I ended up creating some useful test data by hand or automatically generating random “gibberish”. Last week I discovered GenFu with has the following promising tagline “Awesome Test Data”.
GenFu is a library you can use to generate realistic test data. It is composed of several property fillers that can populate commonly named properties through reflection using an internal database of values or randomly created data. You can override any of the fillers, give GenFu hints on how to fill them.
For the following Person class…
…combined with one line of code…
…it generates the following test data…
Looks like magic to me! I’m going to try it out for my next set of unit tests…