Architecture and code are drifting more and more apart? The implementation of non-functional requirements and cross-cutting concerns is often forgotten? Too much spaghetti code due to circular dependencies? Sadly, such things happen far too often and will quickly lead to an unmaintainable code base.
In the Java ecosystem, the library ArchUnit is a possible solution for this situation. We will look at how we can use ArchUnit to test our architecture within unit tests and finally get structure back into the system. We will also look at archunit-spring, which simplifies writing ArchUnit tests for Spring applications.