This chapter will cover the importance of designing test cases before writing tests. We will see what happens when we don’t have test cases in the right sequence. We will work through reversing the digits of an integer kata to illustrate the importance of test cases. This problem uses the Reduction process. Reduction was covered in the previous chapter.
Problem Statement
Reverse the order of the digits of a given positive integer.
Problem Domain Analysis
Table 4-1 shows example input and output for transforming the given integer to its reverse.
Table 4-1. Reverse of a Given Integer
Input | Output ... |
---|