© Bala Paranj 2017

Bala Paranj, Test Driven Development in Ruby, 10.1007/978-1-4842-2638-4_4

4. Importance of Test Cases

Bala Paranj

(1)Atlanta, Georgia, USA

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 ...

Get Test Driven Development in Ruby: A Practical Introduction to TDD Using Problem and Solution Domain Analysis now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.