Palindrome checker is a better basic example of test-driven development

Alonso Del Arte
8 min readNov 25, 2019
Photo by Filip Mroz on Unsplash

A commonly given basic example for test-driven development (TDD) is a function that is supposed to add up two integers. The stub always returns a specific number, like 0, instead of actually adding up its two parameters.

Of course that fails a test that expects something like 1 + 1 = 2. So you change the stub to return 2. But now that fails a…

--

--

Alonso Del Arte

is a Java and Scala developer from Detroit, Michigan. AWS Cloud Practitioner Foundational certified