In performance test it is common to use random numbers for some test data.

Default random functions give you a random number in a range in which each number has the same chance to be picked.

It would be more realistic to use a normal or Poisson distribution.

Does anyone knows some open source Java software that contains advanced random number generators?

  • I Google-searched for "java random number poisson distribution" and "java normal distribution" and found a bunch of code for generating other kinds of distributions in Java, including Poisson.
    – user246
    Commented Sep 1, 2016 at 14:21

2 Answers 2


For instance Apache JMeter has some advanced Timers to simulate virtual users "think time", you can take a look into that direction. Check out A Comprehensive Guide to Using JMeter Timers for more details on i.e.

If you need not to pause the execution but to generate a number, you can check out underlying implementation of these timers here and here


Goal of random numbers is NOT to have "realistic" distribution (for which you need to define mean and SD - how many people will guess right?).

Goal is to have some data with different values to possibly test different code paths.

You also need testing for boundaries, special edge cases, etc. Even if data input has 0.01% chance to be present, your system is no good if it blows up to pieces when encounters such data.

So data with "realistic" distribution is only one of the aspects of your test data, and not even the most important one.

  • I disagree. In my opninion, values that influence performance (time behaviour, resource utilization, efficiency compliance) should be distributed as realistic as possible. However i do agree with you on the fact that you must make sure to test the boundaries,
    – Patrick
    Commented Sep 13, 2016 at 5:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.