ztest is a small classlibrary based on java 1.5 intended to be used in junit tests. The main purpose of ztest is to put constraints on the code structure of java programs. It can and should be used to specify an architecure by putting constraints on class dependencies. The architecture can be reused by reusing the test. ztest scans the bytecode of class files in directories, jars, wars, ears and computes a dependency graph. You can query this dependency graph and define the architecure by specifying valid dependencies and rejecting invalid ones. ztest comes with a dependency-test (ZDependencyTest) with which you can define sets of classes and the allowed dependencies between them. The class sets are defined by filtering the nodes of the dependeny graph.