TNG/ArchUnit
TNG/ArchUnit has 3,893 GitHub stars and 357 forks. GitHot measured +1 stars in 24 hours. Last checked 2026-11-07 16:43 UTC. Last push 2026-11-02.
A Java architecture test library, to specify and assert architecture rules in plain Java
Measured star growth
- in 24h
- +1
- in 7 days
- Update delayed
- in 15 days
- Update delayed
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Original
ArchUnit is a free, simple and extensible library for checking the architecture of your Java code. 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. ArchUnit's main focus is to automatically test architecture and coding rules, using any plain Java unit testing framework.
An Example
Add the Maven Central dependency to your project
Gradle
testImplementation 'com.tngtech.archunit:archunit:1.5.1'
Maven
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit</artifactId>
<version>1.5.1</version>
<scope>test</scope>
</dependency>
Create a test
import com.tngtech.archunit.core.domain.JavaClasses;
import com.tngtech.archunit.core.importer.ClassFileImporter;
import com.tngtech.archunit.lang.ArchRule;
import static com.tngtech.archunit.lang.syntax.ArchRuleDefinition.classes;
public class MyArchitectureTest {
@Test
public void some_architecture_rule() {
JavaClasses importedClasses = new ClassFileImporter().importPackages("com.myapp");
ArchRule rule = classes()... // see next section
rule.check(importedClasses);
}
}
Let the API guide you

Where to look next
For further information, check out the user guide at https://archunit.org or test examples for the current release at ArchUnit Examples.
License
ArchUnit is published under the Apache License 2.0, see https://www.apache.org/licenses/LICENSE-2.0 for details.
It redistributes some third party libraries:
- ASM (https://asm.ow2.org), under BSD Licence
- Google Guava (https://github.com/google/guava), under Apache License 2.0
All licenses for ArchUnit and redistributed libraries can be found within the licenses folder.
Explore related projects
codecrafters-io/build-your-own-x
Master programming by recreating your favorite technologies from scratch.
560,909 starspublic-apis/public-apis
A collective list of free APIs
497,153 starsmorluto/rea
Reverse engineer anything with agents, from app behavior down to native binaries.
442,238 starsopenclaw/openclaw
The AI that really does things. Any OS. Any Platform. The lobster way. 🦞
394,174 stars