Thursday, February 01, 2007

Iced Cava for you programmers

Hey! You Java programmers.. you know Cafe Babe don't you? Thats the first string of hexadecimal numbers 0xCAFEBABE to identify valid JVM files. But as you all know the Java programming language is all about coffee. In many languages one term for Coffee is Cava or Kahva. The concept and the words are known for many years now, but I am rearranging it and tossing a new word: ICeD CaVA - means Iced coffee. This word has the factors to measure the quality of your Java code. Let me explain it how:
I - Instability
Ce - Efferent Coupling
D - Distance from the main sequence
Ca - Afferent Coupling
V - Volatility
A - Abstractness

What does these mean though?

Instability: Is the ratio of Ce/(Ce + Ca). The metric is an indicator of the package resilience to change. I = 0 means a completely stable package. Many of the SDK packages will have its' I = 0. If the changes in other packages does not affect this package then its value is zero.

Efferent Coupling: Is the number of other packages that the classes in this package depends on. Efferent coupling is an indicator of how independent the package is.

Distance from the Main Sequence: The 'D' factor is a metric of the package's balance between the stability and abstractness. Ideal packages are either completely abstract and stable (x = 0, y = 1) or completely concrete and instable (x = 1, y = 0).

Afferent Coupling: Its the number of other packages that depend on the classes in your package. This is a metric indicating the package's responsibility.

Volatility: Is your package going to change or not? java.lang has a V = 0, means creating dependencies on this package is not a cause of concern. If you are starting to build a package, the initial value of V is equal to 1.

Abstractness: This is the ratio of the number of abstract classes and the interfaces to the total number of classes in your package. If A = 0 then its completely a concrete package. A = 1 indicates a completely abstract package.

So here you go, you have a completely freshly brewed cold coffee. Oops! the Iced Cava.

No comments: