© Bala Paranj 2017

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

5. Character-to-Number Conversion

Bala Paranj

(1)Atlanta, Georgia, USA

In this chapter, we will see what happens when we don’t have an algorithm to guide the implementation of the solution during the TDD session.

Problem Statement

Convert the character representation of an integer to its decimal format.

Discussion

Computers can store data in bits (zeroes and ones), which are numbers that can be converted to decimal, octal, etc. They cannot store letters or other special symbols. ASCII character encoding allows computers to store letters, text, symbols, and control characters.

Solution Domain Analysis

Let’s convert the four-character sequence ‘1984’ to the decimal ...

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.