- "Debugging" should be reduced to a minimum, while instead Unit testing and Regression testing should be used.
- With every bug found the must actually make the system stronger, by adding test cases (permanently!) so that this bug will be detected in the future.

The task is to sort three numbers x,y,z by using if-then-else instructions. This needs thorough testing, by considering all possibilities:

- All numbers equal: (1,1,1).
- Exactly two of them equal: (1,1,2), (1,1,0), (1,2,1), (1,0,1), (2,1,1), (0,1,1).
- All numbers different: (1,2,3), (1,3,2), (2,1,3), (2,3,1), (3,1,2), (3,2,1).

These are really all cases, provided the program only uses equality and inequality comparisons between the numbers.

Oliver Kullmann
Last modified: Fri Sep 25 17:07:33 BST 2009