© Greg Donald 2024
G. DonaldHands-on Test-Driven Developmenthttps://doi.org/10.1007/978-1-4842-9748-3_2

2. What Is Test-Driven Development?

Greg Donald1  
(1)
Clarksville, TN, USA
 

Test-driven development is a powerful software development technique where the test (or spec) is written before the implementation code. Initially, the test will fail because the implementation code does not exist yet. This situation with a failing test is expected and is known to drive out minimal implementation code changes or additions to get the failing test into a passing state. It may sound complicated at first, but with a thorough demonstration of the benefits, followed by a bit of practice, you’ll begin to prefer doing things this way.

But what happens when we don’t ...

Get Hands-on Test-Driven Development: Using Ruby, Ruby on Rails, and RSpec now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.