
References
include dependencies info for each (what parts it can see and what it can’t, what it trusts and what it doesn’t)
PortAdapter- Contract test
- Simulator
- Application
- Core
- Simulator test
- How they come together
Tutorials
- Create a new service that uses an API, a data store, & exposes an API (3 ports).
- Shopping cart for small, in-person business
- Port 1: items
- Data store
- Simulator
- Port 2: Purchase
- CC
- mail check for delivery
- pick up and pay then
- Already paid (quickbooks transfer between internal accounts)
- Invoice corporate account
- Port 3: client API
- Browser / mobile
- simulator
- Batch processing / business invoicing
- Point of sale system
How-tos
- Add a new port (and stuff) to one edge of an existing service.
- Refactor access of API to be behind a port & get it under test.
- Respond to a change in behavior by a dependency
- Encapsulate into adapter
- Expose through Port
- Add complexity to Port (meeting new needs of application)
- Detect impact of breaking change or upgrade (using platform tests)
- Detect impact of a breaking change on your consumers
Explanations
- Interlocking tests. From adapter to adapter across contract tests. Or between adapter and application across simulator test + simulator + contract test.
- Contract tests as platform tests to detect upstream breaking changes
- Contract tests as customer acceptance tests to determine impact of breaking changes
- Producer / consumer interaction models (consumers know producer, consumers and producers know each other, consumers know each other and producer), and how that impacts upgrade
- It’s about point of view — “self vs other”.