Abstract: Cucumber can be used to test just about anything. Today. we're going to use Cucumber to test-drive an internet radio running on a Raspberry PI. It's going to be fun. And maybe a bit noisy!
Along the way, you'll learn techniques for isolating your tests from external dependencies.
At work, you probably struggle with tests that call out to other teams' APIs, or hit slow-running databases, or run behind awkward-to-automate user interfaces. Today, you'll be confronted with physical button that's impossible to automate (unless you built a robot!) so what are you going to do?
You'll experience how to de-couple your code from the real world using a ports-and-adapters or hexagonal architecture. You'll learn how this has advantages for testability and makes for a natural separation of concerns that makes the code easier to read too.
Learning Outcomes:
- - build an internet radio using a raspberry pi, a couple of resistors and a push-button
- - refactor coupled code towards a ports-and-adapters design