Thomas Much

Information & Communications Technology

Modern Agile Pair Programming Mob Programming Coaching Java Java EE Enterprise Java / Jakarta EE Monoliths Microservices Software Architecture Continuous Software Development

Hamburg, Germany

ArchUnit - Unit Testing Architecture and Design

Most projects probably have some kind of documentation of the architecture and code conventions. It's just a question of: Where? And are these documentations up to date? Does the code really adhere to these standards? In the field, documentation is all to often "write-only" and bears only faint resemblance to reality.

Wouldn't it be nice if your architectural and coding rules were checked automatically, as part of your continuous integration build? And if architecture wasn't just an occupation of some distant architect, but rather a team sport for all developers, like in an agile, cross-functional team?

With "ArchUnit" it's possible to code your architectural decisions as plain Java (or Kotlin) rules, using an easy to read fluent API. These rules can check for layered architectures, vertical slices, hexagonal (onion style) architectures, acyclic package dependencies, and for coding conventions like namings, containment of classes in packages and the use of annotations and exceptions. The rules can be checked by any unit testing framework, as for instance JUnit.

You'll see the basics of ArchUnit along with practical tips and tricks, including how to write custom rules. There will be some slides, but mostly live coding.


Thomas Much

Technical Agile Coach

Thomas works as a Technical Agile Coach at Die Techniker (TK) in Hamburg. Together with his coaching colleagues, he supports teams in always getting a little bit better at collaboration and agile programming practices – by encouraging pair and team programming, TDD, test automation and the like.

  @thmuch
  javabarista.de (blog)
  tk.de/IT (company)

Thomas's full speaker profile