Mastering Testing in a Hexagonal Architecture
summary
Argues a concrete mapping: unit tests for domain (many small, fast tests that avoid mocking core logic), contract tests for ports (verify adapter implementations against domain contracts), adapter tests target real infra only where behavior matters, and short backend journey tests exercise end-to-end flows without the frontend. Recommends factories and minimalistic test doubles to cut setup time, warns that 100% line coverage can be meaningless, and champions mutation testing to reveal weak or missing assertions.
AI-written summary · about
chapters (16)
- 0:00Introduction and welcome
- 1:11Hexagonal architecture overview
- 4:29Ports and adapters explained
- 6:45Challenges of testing in hexagonal
- 8:15Testing business logic in domain
- 11:30Mocking and test doubles
- 14:44Writing unit tests for ports
- 16:13Practical testing example
- 19:14Integration vs unit tests
- 21:08Coverage and test quality
- 23:24Effective test assertions
- 24:51Testing domain constraints
- 26:21Importance of testing culture
- 27:50Test time efficiency
- 28:41Testing adapters and ports
- 30:08Q&A and closing
related talks
47mToo Many Mocks Kill the Test: What Hexagonal Architecture Changed
37mTDD and Hexagonal Architecture in Microservices
21mTestable Architecture: Keep 'em Separated
57mAdvanced Testing Techniques: Tips from the trenches
53mThe Grand Unified Theory of Clean Architecture and Test Pyramid
46mHow to fall in love with TDD
25mTestable Architecture: Keep 'em Separated
47mThe Grand Unified Theory of Clean Architecture and Test Pyramid
