Reputation: 2563
I'm currently testing a calculator application for a university assignment, I have identified 3 equivalence classes:
When selecting a value of an equivalence class to use in a unit test, should the value be randomly generated or should the same value be used every time?
Upvotes: 0
Views: 439
Reputation: 2071
You can use the same numbers, that's the point of equivalence classes. If you've defined the classes well, it will do the job. Your classes for this problem seem ok to me in this sense.
On the other hand, tests with random numbers can be a good idea since it can help you discover new classes (maybe some classes you missed at first). Extra tests usually don't hurt, but make sure you still have non-random tests.
Upvotes: 1