Gregory M. KapfhammerAssociate Professor of Computer Sciencehttp://www.cs.allegheny.edu/~gkapfham/ |
Lab Six, Group Eight: Debbie Wright and Joseph Zumpella
1. Design Quality metrics:
CC - concrete Class Count - number of actual classes
AC - Abstract Class (and Interface) Count - number of abstract classes
CA - Afferent Couplings (Ce)number of classes this package relies on
CE - Efferent Couplings (Ce)number of classes relied on by this package
A - Abstractness (0-1) ratio of abstract classes to total classes, 0 is concrete, 1 is totaly abstract.
I - Instability (0-1)ratio of efferent classes to total classes, 0 is completely stable, 1 is completelyunstable
D - Distance from the Main Sequence (0-1), the balance between abstactness and instability.
Cyclic - If the package contaings a dependency cycle (not done by jdepend, in this version at least)
From www.clarkware.com/software/JDepend.html
"JDepend does not currently support the calculation of Ca and Ce in terms of the number of classes inside a package tha have afferent or efferent couplings to classes inside other packages. Rather, JDepend calculates Ca and Ce strictly in terms of the number of packages with which a package has afferent or efferent couplings, based on the collective analysis of all imported packages. this deviates slightly from the original Ca and Ce definitions proposed by Robert Martin"
2. Results and analysis of lab2: lab2 code
java jdepend.textui.JDepend /home/dwright/cs290/lab02
Package: Default
Stats:
Total Classes: 13
Concrete Classes: 9
Abstract Classes: 4
Ca: 0
Ce: 1
A: 0.31
I: 1
D: 0.31
Abstract Classes:
Operator
PostfixComponent
PostfixOperatorVisitor
ReflectiveVisitor
Concrete Classes:
DivideOperator
MinusOperator
PlusOperator
PostfixEvaluator
PostfixOperatorEvaluatorVisitor
TestPostfixEvaluator
TestPostfixOperatorEvaluatorVisitor
TimesOperator
VisitableInteger
Depends Upon:
junit.framework
Used By:
Not used by any packages.
Package: junit.framework
No stats available: package referenced, but not analyzed.
Package Dependency Cycles:
Summary:
Name, Class Count, Abstract Class Count, Ca, Ce, A, I, D:
Default,13,4,0,1,0.31,1,0.31
junit.framework,0,0,1,0,0,0,1
CC is 9 because there are 9 concrete classes analyses (total 13 classes)
AC is 4 since there are 4 abstract classes
CA is zero since zero packages depend on any of these classes
Ce is 1 because the test classes, depend upon the JUNIT package.
A - Abstractness is given a 0.31. this means that it is not very abstract. it is calculated by the ratio of abstract class to total classes, 4/13.
I - Instability is 1, which means it is very unstable, and should not be depended on by any other packages (which it is good that none do!)
D - Distance from main sequence is 0.31. this is relatively close to the main sequence, so it is somewhat balanced with respect to it's abstractness and instability.
3. Results and analysis of lab3: lab3 code
java jdepend.textui.JDepend /home/dwright/cs290/Lab3
Package: Default
Stats:
Total Classes: 1
Concrete Classes: 1
Abstract Classes: 0
Ca: 0
Ce: 0
A: 0
I: 0
D: 1
Abstract Classes:
Concrete Classes:
WrongKindOfIdentifierException
Depends Upon:
Not dependent on any packages.
Used By:
Not used by any packages.
Package: Identifier
Stats:
Total Classes: 2
Concrete Classes: 2
Abstract Classes: 0
Ca: 0
Ce: 0
A: 0
I: 0
D: 1
Abstract Classes:
Concrete Classes:
Identifier
IdentifierTable
Depends Upon:
Not dependent on any packages.
Used By:
Not used by any packages.
Package: default
Stats:
Total Classes: 2
Concrete Classes: 2
Abstract Classes: 0
Ca: 0
Ce: 1
A: 0
I: 1
D: 0
Abstract Classes:
Concrete Classes:
TestIdentifier
TestIdentifierTable
Depends Upon:
junit.framework
Used By:
Not used by any packages.
Package: junit.framework
No stats available: package referenced, but not analyzed.
Package Dependency Cycles:
Summary:
Name, Class Count, Abstract Class Count, Ca, Ce, A, I, D:
Default,1,0,0,0,0,0,1
Identifier,2,0,0,0,0,0,1
default,2,0,0,1,0,1,0
junit.framework,0,0,1,0,0,0,1
since abstractness is 0, instability is 0 and distance is 1, this is concrete, stable, and very poorly balanced.
the Ca are all 0 since no classes rely on them,
the only Ce that is one is because it relies on junit.
4. Results and analysis of JUNIT: did not submit this code, too complex.
General overview. it has 3 efferent packages, and 7 afferent packages
in general they have an abstractness of 0-.3, and an instability of .8 to 1. they are pretty much balanced.
Package: junit.samples.money
Stats:
Total Classes: 4
Concrete Classes: 3
Abstract Classes: 1
Ca: 0
Ce: 2
A: 0.25
I: 1
D: 0.25
Abstract Classes:
junit.samples.money.IMoney
Concrete Classes:
junit.samples.money.Money
junit.samples.money.MoneyBag
junit.samples.money.MoneyTest
Depends Upon:
junit.framework
junit.textui
Used By:
Not used by any packages.
this package has two efferent dependencies, it depends upon junit.framework and junit.textui.
its abstractness is 0.25 and its instability is 1, the distance is 0.25. this means that it is a concrete and unstable package, and is fairly well balanced.
Stats:
Total Classes: 2
Concrete Classes: 2
Abstract Classes: 0
Ca: 0
Ce: 1
A: 0
I: 1
D: 0
Abstract Classes:
Concrete Classes:
TestIdentifier
TestIdentifierTable
Depends Upon:
junit.framework
Used By:
Not used by any packages.
Abstractness is zero, instability is 1, and distance is zero. this package is concrete, unstable, and completely balanced.
Package: junit.tests
Stats:
Total Classes: 26
Concrete Classes: 26
Abstract Classes: 0
Ca: 1
Ce: 4
A: 0
I: 0.8
D: 0.2
Abstract Classes:
Concrete Classes:
junit.tests.ActiveTestTest
junit.tests.AllTests
junit.tests.AssertTest
junit.tests.ClassLoaderTest
junit.tests.ExceptionTestCaseTest
junit.tests.ExtensionTest
junit.tests.Failure
junit.tests.InheritedTestCase
junit.tests.LoadedFromJar
junit.tests.NoTestCaseClass
junit.tests.NoTestCases
junit.tests.NotPublicTestCase
junit.tests.NotVoidTestCase
junit.tests.OneTestCase
junit.tests.OverrideTestCase
junit.tests.RepeatedTestTest
junit.tests.SorterTest
junit.tests.StackFilterTest
junit.tests.Success
junit.tests.SuiteTest
junit.tests.TestCaseClassLoaderTest
junit.tests.TestCaseTest
junit.tests.TestImplementorTest
junit.tests.TestListenerTest
junit.tests.TextRunnerTest
junit.tests.WasRun
Depends Upon:
junit.extensions
junit.framework
junit.runner
junit.textui
Used By:
junit.samples
abstractness is 0, instability is 0.8, and distance is 0.2. this package is concrete, fairly unstable, fairly well balanced.
it is used by one class, junit.samples, and it depends on 4 classes, junit.extensions, junit.framework, junit.runner, junit.textui
5. Pitfalls and Problems
we had problems installing the jdepends2.2, had to copy it from the data /net folder
while working on introduction stuff, getting the swingui to work on the sample, it gave us major errors. it told us " Exception in thread "main" java.lang.NoClassDefFoundError: jdepend/swingui/JDepend"
note: did not have to unzip the jdepend2.2 file, simply copy it into your home folder. did not have to do the stuff with the ant command, we don't have the ant command. when setting the classpath, use setenv, not export.
our classspath should be correct, and we did change the permissions on it, using the instructions given on the clarkware.com webpage on JDepend. we will try to corner Greg to ask him whats happening, asked Rich Geary and he did not know either.
had some problems with my java, found it had an alias problem, fixed ir with gregs help. once that was fixed, tried swingui again, worked perfectly, as did testui.
Deb Wright
Joe Zumpella
Link to this Page
- Laboratory Six: Object-Oriented Design Quality Metrics last edited on 24 October 2002 at 3:48 pm by alden28.alleg.edu