Sort test cases

De Software testing
Ir para: navegação, pesquisa

Consider a sort implementation for a array of integers. The input of the sort application, the array, is set as the argument of the application, and the result is printed to the console. For example, for the input array '3 1 7 4', the result would be:

$ sort 3 1 7 4 1 3 7 4

Thus, a possible set of test cases is:

  • <[3, 1, 7, 4], [1, 3, 7, 4]>
  • <[1, 2, 3, 4], [1, 2, 3, 4]>
  • <[0, 1, 0, 2], [0, 0, 1, 2]>
  • <[], []>
  • <[a, b, 0, 1], error message printed to console>