ArchUnit - Unit Testing Architecture and Design
summary
ArchUnit lets teams encode architecture as executable Java/Kotlin rules that run as unit tests (JUnit4/5) and as Maven/Gradle checks; it inspects bytecode to enforce bytecode-level checks like package containment, acyclic slices, layered and hexagonal (onion/ports-and-adapters) constraints, naming patterns, and annotations. Demo shows concrete rules: classes in api packages must be public, no @Stateful EJBs, classes ending with "Impl" must live in backend or be @Deprecated. It supports PlantUML import, ignore-patterns and a freeze violations store to prevent new regressions while migrating legacy code.
AI-written summary · about
chapters (20)
- 0:00Introduction
- 0:55Who am I
- 1:42Architecture
- 3:45Why test architecture
- 8:25How does it work
- 11:57Live demo
- 14:37Requirements
- 17:32Reflection
- 19:05Transformer
- 20:05ArchRule
- 20:50Changing Modifiers
- 23:29Architecture Violation
- 30:27ArchUnit Ignore Patterns
- 31:56Freezing Architecture
- 34:11Enabling Store
- 34:54Store Files
- 36:56ArchUnit
- 38:06Examples
- 42:46Why use ArchUnit
- 45:16Questions
related talks
49mArchUnit: Guarding the Logic of Your Application
45mUnit Test Your Java Architecture With ArchUnit
22mArchitecture & ArchUnit
24mUnit Testing Your Architecture
43mUnit Test Your Java Architecture With ArchUnit
42mFitness Functions for Your Architecture – in Practice
21mTestable Architecture: Keep 'em Separated
32mMUnit: your new favorite Scala testing library?
