ztest
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.
The key to agility is being able to modify code easily and safely. The problem is that many Java applications are too brittle to extend and enhance easily. Attempts to fix or extend - no matter how carefully done - can introduce more bugs and more complexity.
With a full suite of characterization tests generated by JUnit Factory you can bring your legacy code under control. Download our free plug-in for Eclipse to get started.