The Strategy Pattern is used to isolate multiple algorithms, or strategies , that perform a specific task into modules that may be swapped in and out at run time. This chapter uses test‐driven development to show how, through the use of strategies, algorithms may be added or removed in a way that's independent from the client, or context, that uses them. It illustrates how programming to the interface of a strategy improves the testability, and thus reliability, of the code that consumes the strategy. One of the benefits of correct implementation of the Strategy Pattern is that strategies may be added or removed with very little code change. By using the Strategy Pattern, however, the code in redicabTransportCompany is solely concerned with the details of interacting with the RediCab API. When creating strategy modules, it's important to write unit tests to verify that the implementations expose the correct interface.