Book Image

Test-Driven Java Development

Book Image

Test-Driven Java Development

Overview of this book

Table of Contents (17 chapters)
Test-Driven Java Development
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
8
Refactoring Legacy Code – Making it Young Again
Index

Summary


BDD, in its essence, is a flavor of TDD. It follows the same basic principle of writing tests (scenarios) before the implementation code. It drives the development and helps us better understand what should be done.

One of the major differences is the life cycle duration. While with TDD, which is based on unit tests, we're moving from red to green very fast (in minutes if not seconds); BDD often takes a higher-level approach that might require hours or days until we get from the red to the green state. Another important difference is the audience. While unit tests-based TDD is done by developers for developers, BDD intends to involve everyone through its ubiquitous language.

While a whole book can be written on this subject, our intention was to give you just enough information so that you can investigate BDD further.

Now it is time to take a look at legacy code and how to adapt it and make it more test-driven development friendly.