r/softwaretesting • u/EarlOfAwesom3 • Jul 15 '26
Testing Java Backend with Random Data Input
Ho everybody. Experienced Java Backend developer here, looking for some advice on testing with random data.
I want to investigate possibilities to execute some stress tests on our Backend and API with datasets that are randomly set up on each test run.
Why? Because the software I am working on has a huge combination of different settings and inputs. Unfortunately we test with static data and thus only some happy paths are executed.
I expect those tests to fail and hopefully deliver some edge cases that we are currently missing on our radar.
Our suite contains mainly unit tests and integration tests (with test container DB)
Does someone have experience and thus some advice with random data tests? Is it worth it or am I expecting too much out of it? Where are the pitfalls and best practices?
Are there any recommended java libraries that help with such a setup?
Thanks
View all comments
Show parent comment
1
u/EarlOfAwesom3 Jul 15 '26 edited Jul 15 '26
Mostly truly random, in regards to the data type.
Imagine an API that sends an object that contains a lot of optional data. There can be null (absence of value), empty or some data accoding to the type.
The goal is to test the backend for resillience against those (random) combinations of possible values.
Sure there might be some rules that say: if A is present, so must B. But that is for the backend to handle.
Maybe as addition: verification of business rules will be hard to impossible, because of randomness. The only verification I can imagine would be: there shall be no internal exception.