Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
time to test equals() and hashCode() depends exponentially on the number of fields #203
In the project
The first class is tested in no time, the second one takes about a minute, and the test for the third one did not terminate for me (but probably it would in about half an hour, unless it would take too much memory). UPD: bigTest failed after 8m 49s with
It is important to test
I propose the following algorithm:
Start with 3 POJO objects, one filled with nulls (zeroes, etc.), and two others filled with values that do not repeat (well, it is difficult to find 20 different boolean values).
On the first iteration, we will compare
On the second iteration, we will compare
On the 3rd iteration, we will compare
and so on.
Note. This issue may be related on unrelated to #201
(UPDATE) Note 2. I believe, it is
I have added a patch to the same https://github.com/36893488147419103231/pojo-tester-tester project.
Strictly speaking, it is quadratic rather than linear, but it is not that much important.