Adding New Behavior

When you think about it, the process of adding new behavior to a system isn’t so different from fixing a bug. The overall goal is to change some aspect of how the system behaves, without breaking anything else.

Just as with bug fixing, we can use characterization tests to pin down the surrounding behavior of the system to make sure it isn’t dislodged by our work. Characterization tests can also be useful before that, while the new feature is first being considered. You can use them to help understand how much work is involved in the new feature by clarifying exactly what the system currently does.

Here’s our recipe for adding new behavior to a legacy system:

  1. Examine the new feature. If necessary, write a few characterization ...

Get The Cucumber Book 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.