Every complex software product has a variety of software architecture concepts that directly affect the code base. Which types of components do we have, how do we identify these components, how do we structure them and how are they allowed to depend on each other and through which interfaces. However, in an Agile environment with many developers and distributed roles, it becomes harder and harder to keep a common understanding of the software architecture and a consistent code structure.
If the software architecture deteriorates, costs for development will rise. Also fixing the code structures will become more and more expensive, the longer it takes to find and fix architecture violations. Thus every project should establish an automated test process to continuously check for violations and allow developers to fix them, while the costs are still low. This presentation showd through lots of live coding, how the open source library ArchUnit can help to maintain these structures. ArchUnit at its core imports Java byte code and offers many properties which can then be tested by abstract rules as plain unit tests. Whether certain classes should only be accessed by certain packages, certain annotations mark public API or certain classes form a module that only exports a dedicated API. ArchUnit can be tailored to any project’s needs, it can be used to add missing scopes (like sub-package) or introduce modules similar to Jigsaw in Java 8 or even Java 7 projects.
Video producer: https://javazone.no/