Reputation: 153
Hi I have problem with how to test my sort arrays. I have no problem in the coding of them however we are supposed to develop "smart" test cases. To test the sorting methods.
I dont get what the smart cases would be. I know if I was developing a calender a smart thest case would be the last day of the year etc. However I dont understand it for sorting.
The only thing I can think of would be the middle element the first and the last.
I dont want any code just some feedback on what you thing smart cases would be.
Upvotes: 1
Views: 46
Reputation: 1416
You could try to sort in increasing order:
Afetr analising the performance on those, you could try:
Upvotes: 1
Reputation: 23322
If you're checking for correctness, you may want to try:
[5,4,3,2,1]
[1,1,3,3,2,2]
[1,1,1,1,1]
If you're going to use associative arrays, you may want to check for stability.
If you're checking for runtime complexity, you may also want to try longer arrays.
Upvotes: 1