[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Originally posted by Layne Lund:
My main concern is that the first option can potentially use a lot of memory to create all those instances. If paramListA has m values and paramListB has n values then there will be m*n instances of the test case. In this particular project, both m and n have the potential to be rather large. Of course, I probably should gather some more precise statistics before I worry about it too much. But for the sake of argument, how should I mitigate the potential for large amounts of memory usage?
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Originally posted by Layne Lund:
I think I understand what you mean by "partitioning," but I don't see how this will save memory usage. I guess as described above, I could partition the random values for "list B" from the static ones. However, "list A" will remain the same for both. It seems like the same number of objects will be created. The only difference I see is that it is possible to limit how many objects are created at a given time. Is that what your suggesting or am I missing something?
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Originally posted by Jeanne Boyarsky:
We have 1600 Test case objects in one of our projects without any memory issues. And yes, that is test case objects rather than tests.
So I suggest trying it and seeing what happens. If there are memory problems, the easiest workaround is to initialize your larger attributes to null in the tear downs. Or all the attributes in the parameterized test case could be set to null since there are more of them.
Originally posted by Jeanne Boyarsky:
We have 1600 Test case objects in one of our projects without any memory issues.