Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Immer wieder die gleichen Fehler? Nicht mit ArchUnit!

Immer wieder die gleichen Fehler? Nicht mit ArchUnit!

Roland Weisleder

September 07, 2022
Tweet

More Decks by Roland Weisleder

Other Decks in Programming

Transcript

  1. @Ro_Wei
    Roland Weisleder ✉ [email protected]
    Immer wieder die gleichen Fehler?
    Nicht mit ArchUnit!

    View full-size slide

  2. Sicherheitslücke
    Kein Logging
    Überlastung durch
    fehlende Caches
    NullPointerExceptions
    durch falsche Serialisierung
    Datenkorruption

    View full-size slide

  3. Nicht-funktionale Anforderungen
    nicht bekannt oder falsch umgesetzt

    View full-size slide

  4. Kann euch das auch passieren?

    View full-size slide

  5. Mehr automatisiert testen?
    Codebasis ändert sich Team ändert sich
    Anforderungen ändern sich

    View full-size slide

  6. 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/

    View full-size slide

  7. 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/

    View full-size slide

  8. 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/

    View full-size slide

  9. 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/

    View full-size slide

  10. 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/

    View full-size slide

  11. Fehlerhafte Strukturen mit ArchUnit finden
    ● Fehlender/Überflüssiger Code
    ● Fehlerhafte Imports
    ● Fehlerhafte Verwendung von Librarys/Frameworks
    ● Ungewollte Abhängigkeiten zwischen Klassen
    ● Abweichungen von der Architektur

    View full-size slide

  12. Warum ArchUnit dafür einsetzen?
    ● Niemand hat ständig alle Regeln im Kopf
    ● Niemand wird ständig alle Regeln nachlesen
    ● Jemand wird Tests vergessen
    ● Regel können sich ändern
    ● Umsetzung von nicht-funktionalen Anforderungen zentral testen
    ● Vorhandener und neuer Code wird getestet

    View full-size slide

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

    View full-size slide

  14. Code:
    https://github.com/rweisleder/find-bugs-with-archunit-examples
    https://github.com/TNG/ArchUnit-Examples
    Sofwarefehler mit ArchUnit aufspüren
    Doku:
    https://www.archunit.org/
    Bringing Legacy Java Systems Into the Future
    rweisleder.de @Ro_Wei
    linkedin.com/in/roland-weisleder

    View full-size slide