Java Code Analysis tool--jdepend

Source: Internet
Author: User

Recently Learning MyBatis official documents, see the "Project Document" section has a lot of content has not seen, make a note, understand.

  

The introduction of the encyclopedia, I can even understand, then do not find other places of information.

  

JDepend an open source code that can be used to Excellent tool for evaluating Java program Quality (definition) , it iterates through the Java class file directory, and automatically generates a package dependency for each package/class in the Java package (How to do), stability, reliability and other evaluation reports, according to these reports, we can get the dependency between the package or class, and analyze the stability of the package, the degree of abstraction, whether there is a cyclic dependency relationship, etc. (use)conforms to object-oriented design         based on the report data given by Jdepend, we can analyze whether our packages are reliable, stable, robust packages that conform to object-oriented design principles . I am, the original object-oriented design can be defined not only by code programming habits, but also by specific quantification tools. The concrete formula is as follows, well, I like the world with the formula most, haha. This is going to be written in a paper, how awesome.    one of the design principles for the Stable abstractions Principle (SAP) : The stable abstract equivalence principle points out that the stability of a package is proportional to its degree of abstraction (the number of interfaces), which means that the larger the proportion of interfaces contained within a package, the more stable the package. abstractness (A): The abstraction of the package. Refers to an abstract class or interface contained within a package that occupies the weight of the class in the entire package. The value is in between 0,1, if a=0, the description package contains no abstract class or interface, if a=1, the description package is all abstract class or interface. The relationship between the abstraction and stability of the package is explained above. afferent couplings (Ca):  Centripetal coupling. The number of external packages (classes) that depend on the package (the contained classes) (i.e. incoming dependencies), the larger the value, the greater the responsibility of the package, and the more stable it is. efferent couplings (Ce):Centrifugal coupling. The number of external packages that are dependent on the package (i.e. outgoing dependencies), the larger the value, the more unstable the package is, because it relies on other packages. instability (I):Measure the degree of instability of a package.
i=ce/(CE+CA)
Its value is between [0,1]. I=0 when the package is the most stable, and vice versa I=1 that the package is very unstable. Distance from the Main Sequence (D):This indicator is mainly used to evaluate the degree of abstraction and stability of the package, which can be represented by a two-dimensional straight line graph A + I =.
D=abs ((A + I)-1)
, that is, D is the degree of abstraction of a package + the absolute value of the package's instability-1. An ideal package is: Completely abstract (a=1), very stable (i=0), then d=0, or: a completely concrete class consisting of a package (a=0), very unstable (i=1), then there is also d=0. D=0 the degree of abstraction of the package is balanced with the degree of stability, whereas d=1 indicates that the package's balance is severely damaged.Package Dependency Cycles:The loop dependency of the package. (This can be done with object graph traversal, but not efficiently. Otherwise linear lookup. )  

  

Java Code Analysis tool--jdepend

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.