Slide 1

Slide 1 text

@Ro_Wei Roland Weisleder [email protected] Unit Test Your Java Architecture With ArchUnit

Slide 2

Slide 2 text

Whoever wishes to build high towers must spend much time near the foundation. Anton Bruckner

Slide 3

Slide 3 text

Source: https://unsplash.com/photos/AF36q06J8fQ

Slide 4

Slide 4 text

Source: https://xkcd.com/2347/

Slide 5

Slide 5 text

Source: https://www.monkeyuser.com/2019/v-201/

Slide 6

Slide 6 text

Source: https://unsplash.com/photos/snNHKZ-mGfE

Slide 7

Slide 7 text

Your usual Challenges Architecture Rules Code Reading Documentation? Reviewing adherence to architecture? Architecture and Code will diverge

Slide 8

Slide 8 text

“ArchUnit is a free, simple and extensible library for checking the architecture of your Java code using any plain Java unit test framework. That is, ArchUnit can check dependencies between packages and classes, layers and slices, check for cyclic dependencies and more. It does so by analyzing given Java bytecode, importing all classes into a Java code structure.” https://www.archunit.org/

Slide 9

Slide 9 text

“ArchUnit is a free, simple and extensible library for checking the architecture of your Java code using any plain Java unit test framework. That is, ArchUnit can check dependencies between packages and classes, layers and slices, check for cyclic dependencies and more. It does so by analyzing given Java bytecode, importing all classes into a Java code structure.” https://www.archunit.org/

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

“ArchUnit is a free, simple and extensible library for checking the architecture of your Java code using any plain Java unit test framework. That is, ArchUnit can check dependencies between packages and classes, layers and slices, check for cyclic dependencies and more. It does so by analyzing given Java bytecode, importing all classes into a Java code structure.” https://www.archunit.org/

Slide 12

Slide 12 text

“ArchUnit is a free, simple and extensible library for checking the architecture of your Java code using any plain Java unit test framework. That is, ArchUnit can check dependencies between packages and classes, layers and slices, check for cyclic dependencies and more. It does so by analyzing given Java bytecode, importing all classes into a Java code structure.” https://www.archunit.org/

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

“ArchUnit is a free, simple and extensible library for checking the architecture of your Java code using any plain Java unit test framework. That is, ArchUnit can check dependencies between packages and classes, layers and slices, check for cyclic dependencies and more. It does so by analyzing given Java bytecode, importing all classes into a Java code structure.” https://www.archunit.org/

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

Demo

Slide 17

Slide 17 text

Your usual Challenges Architecture Rules Code Reading Documentation? Reviewing adherence to architecture? Architecture and Code will diverge

Slide 18

Slide 18 text

Benefits of using ArchUnit Architecture Rules Code Easy to use in legacy projects ☺ Automatically executed Failing Unit Tests on violations

Slide 19

Slide 19 text

Der Schiefe Turm von Java Mit ArchUnit Architekturfehler frühzeitig finden und vermeiden Java Magazin 1.2024

Slide 20

Slide 20 text

https://github.com/rweisleder/archunit-spring

Slide 21

Slide 21 text

Testing can detect only the presence of errors, not their absence.

Slide 22

Slide 22 text

Unit Test Your Java Architecture With ArchUnit Code github.com/rweisleder/archunit-talk-examples github.com/TNG/ArchUnit-Examples Docs archunit.org jmolecules.org Slides speakerdeck.com/rweisleder/unit-test-your-java-architecture-with-archunit Want to Bring Your Legacy Java System Into the Future? [email protected] linkedin.com/in/roland-weisleder