# TNG/ArchUnit

A Java architecture test library, to specify and assert architecture rules in plain Java

Repository: https://github.com/TNG/ArchUnit
Canonical: https://ross.abutalabs.com/products/archunit
Homepage: https://archunit.org
Language: Java
License: Apache-2.0
License Family: permissive
Last push: 2026-08-24T08:09:32+00:00

## Health v2 (maintenance only)
Score: 94/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 84, longevity 100
- inputs: {"age_days": 3421, "days_push": 9, "days_rel": 29, "gap_med": 48, "n_releases_24m": 6}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3810, forks 347 (observed 2026-08-28T04:08:20.521856+00:00)

## What it is
ArchUnit is a free, extensible Java library for checking the architecture of Java code by analyzing bytecode and asserting rules as plain unit tests. It verifies dependencies between packages, classes, layers, and slices, and detects cyclic dependencies using any Java testing framework.

## Use cases
- enforce layered architecture rules in Java tests
- detect cyclic package dependencies
- assert classes only depend on allowed packages
- prevent domain layer from depending on controllers
- run architecture checks in CI as unit tests
- define custom architecture rules with a fluent API

## When to choose
- you have a Java/JVM codebase and want automated architecture governance
- you want architecture rules to run as ordinary unit tests in your existing test setup
- you need to enforce layering, slicing, or dependency constraints continuously

## When to avoid
- your project is not on the JVM
- you need runtime architecture enforcement rather than build-time tests
- you need full static analysis beyond bytecode-level dependency checks

## Facets
- artifact type: library
- maturity: stable
- function: testing, parser, developer-tools
- domain: testing, developer-tools
- platform: jvm, cross-platform
- tags: architecture-tests, bytecode-analysis, java, static-analysis, unit-testing, architecture

## Member repositories
- TNG/ArchUnit (main) score 94

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:20.521856+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:26:37.783782+00:00, confidence not recorded.
  - readme: https://github.com/TNG/ArchUnit (fetched 2026-08-28T04:08:20.521856+00:00, sha 78e6650fb887)
  - homepage: https://archunit.org (fetched 2026-08-29T09:21:32.629717+00:00, sha 14fdd65815da)
  - site_page: https://www.archunit.org/about (fetched 2026-08-29T09:21:32.640817+00:00, sha 9b4c93df5d4f)
  - site_page: https://www.archunit.org/getting-started (fetched 2026-08-29T09:21:32.638902+00:00, sha 3a7445ebdf1c)
- Data as of 2026-08-30T08:39:29.467469+00:00.
