I'd like to mock up object data, not the objects themselves. In other words, I would like to generate a collection of n objects and pass it into a function which generates random data strings and numbers. Is there anything to do this? Think of it as a Lorem Ipsum for object data. Constraints around numerical ranges etc. are not necessary, but would be a bonus.
The first thing I thought of when I read your question was QuickCheck, a testing tool for Haskell. In QuickCheck you specify properties (invariants) that your function should have, and you can specify valid ranges for inputs (plus a bunch more features), and QuickCheck will generate a bunch of random input data and throw it at your function and check too see if the output matches the specification. Nosing around a little I found out there is an F# port of it so QuickCheck exists in the .net world:
http://fscheck.codeplex.com/
There is also a MS Research project Pex that might be close to what you are thinking of:
http://research.microsoft.com/en-us/projects/Pex/
"...Pex finds interesting input-output values of your methods, which you can save as a small test suite with high code coverage. Microsoft Pex is a Visual Studio add-in for testing .NET Framework applications."
I haven't used it before, but it looked like it is good for generating edge case data that exercises any and all branches of a function. It actually analyzes a function rather than just throwing truly random stuff at it.
There also appears to be a .NET port of the Ruby Faker
gem, which gets a lot of use for rigging fake data objects in Ruby. I haven't used it, but it might be worth looking into:
https://github.com/slashdotdash/faker-cs
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With