O'Reilly logo

The Cucumber Book, 2nd Edition by Steve Tooke, Aslak Hellesoy, Matt Wynne

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing the New Architecture

So that we can show you what it’s like to have a flickering scenario, we’ll start by changing the architecture underneath the same test code. We’ll demonstrate the flickering scenario and, in a final flourish, fix it by changing the tests to use sampling to synchronize with the system.

Driving Out the Interfaces

The Account class is where the ATM is going to interface with our new backend services. As shown in the figure ​here​, the two touch points are the TransactionQueue and the BalanceStore. Let’s design the interfaces to those objects by changing our Account class to use two imaginary objects that can talk to these services:

 require_relative ​'transaction_queue'
 

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required