Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8440691
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:21:33+00:00 2026-06-10T08:21:33+00:00

What library / method can I use for deep generation of random objects for

  • 0

What library / method can I use for deep generation of random objects for a given class in Java / Scala?
By deep generation I mean recursively filling the entire object graph with random values, for both primitive and complex types.

The goal is to use randomly generated mock objects for tests.

To make the tests consistent and reproducible, the set of generated objects should be identical on every run.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T08:21:35+00:00Added an answer on June 10, 2026 at 8:21 am

    As far as I know there are there are two powerful methods to randomly generate very large, arbitrary types of object. The first is called the recursive method (introduced by Wilf and Nijenhuis, formalized by Flajolet, van Cutsem and Zimmerman), the second is called Boltzmann sampling by Duchon, Flajolet, Louchard and Schaeffer.

    In both methods, you give a structure definition (a “grammar”) and you are returned with a large random object which is in accordance with the grammar.

    Both have been used very successfully in wide scale testing of programs (similar to Haskell’s QuickCheck). Unfortunately, while there are some various implementations of the methods, I don’t think there is a ready to use library for Java. For example of what can be done, you might want to check Yann Ponty’s page with Java implementations of these methods for bioinformatics. If you were using OCaml, then Alexis Darrasse and Benjamin Canou have implemented a useful subset of Boltzmann sampling as a completely autonomous library for algebraic types (sumtypes).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am calling a library method that is synchronous. I'd like to use the
I have created a class library called AddServiceLibrary in which I have a method
I'm attempting to use the DatabaseFactory method from the Microsoft Enterprise Library. using Microsoft.Practices.EnterpriseLibrary.Data;
Is there a straighforward library that I can use to access the CIL for
I'm developping a communication library based on NIO's non-blocking SocketChannels so I can use
My main process calls an external library method. This method sometimes hangs. I can
I'd like to use NIO.2 features with Scala (classes are in java.nio.file): In Java
We have a database library in C# that we can use like this: DatabaseConnection
1) Which JavaScript hashchange/history library/method should I use for my JavaScript application? 2) And
We can use the SuperObject library to invoke methods of a certain object by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.