SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


Smell Detectors and Metrics for Cultivate 0.3 Milestone 2

Metric detectors

Structure detectors evaluate certain structures and return a numeric value in a metric specific range for them, if they can be calculated (sometimes division by zero prevents calculation).

Test are contained in prolog-tests/org/cs3/cultivate/pl/metrics/

MetricGranularityDescriptionTest Case
abstractnesspackagenumber of abstract classes in category ÷ total number of classes in categoryAbstractnessTest.java
afferent couplings (Ac)packagenumber of classes outside this package that depend upon classes within this packageAfferentCouplingTest.java
depth of inheritance treeclassnumber of steps up to Object in the inheritance treeDepthOfInheritanceTreeTest.java
distance (normalized)packageDn = abs(Abstractness + Instability - 1)DistanceTest.java
efferent couplings (Ec)packagenumber of classes outside this package that classes within this package depend uponEfferentCouplingTest.java
instabilitypackageEc / (Ac + Ec) if Ac + Ec != 0
0 otherwise
InstabilityTest.java
lcom2classlack of cohesion of methods
(excluding all trivial getters)

1 - (NumberOfMethodsAccessingFields/(NumberOfMethods*NumberOfFields))
LCOM2Test.java
nocclassnumber of children (number of direct subclasses)NOCTest.java
number of abstract classespackagenumber of abstract classesNumberOfAbstractClassesTest.java
number of classespackagenumber of classes, abstract classes and interfaces in a packageNumberOfClassesTest.java
number of descendantsclassnod = number of descendants (direct and indirect subclasses)NumberOfDescendantsTest.java
number of interfacespackagenumber of interfaces in a packageNumberOfInterfacesTest.java
number of overridden methodsclassnorm = number of overridden methodsNumberOfOverriddenMethodsTest.java
sixclassspecialization index

(depthOfInheritanceTree*NumberOfOverriddenMethods)/NumberOfMethods
SIXTest.java
static test coverageclasspercentage of public methods called by testsStaticTestCoverageTest.java

Smell Detectors

Structure detectors detect structures that are bad smells.

Test are contained in prolog-tests/org/cs3/cultivate/pl/smells/

SmellGranularityDescriptionTest Case
no operation (nop)statementempty statementsNopSmellTest.java
misnamed testclassclasstest class that's name does not end with “Test”MisnamedTestclassTest.java
sideeffects in gettersmethodgetters do more than calculate results and return them

proposal: categories no side effects, possible side effects, known side effects
SideEffectInGetterTest.java
for testers onlymethodfinds methods that are only used by testsForTestersOnlyTest.java
package circularitypackagefinds all strongly connected package components with more than one package in the package dependency graph

Structure Detectors

Structure detectors detect structures like inheritance or package dependencies. Their results are used in different diagrams.

Test are contained in prolog-tests/org/cs3/cultivate/pl/structures/

StructureGranularityDescriptionTest Case
class dependencyclasschecks whether on class depends on another or notClassDependencyTest.java
package dependencypackage
inheritanceclasschecks if one class extends anotherInheritanceTest.java

Queries

Queries allow further investigation on certain PEFs from special views, sophisticated java analyzers etc.

Test are contained in prolog-tests/org/cs3/cultivate/pl/queries/

QueryGranularityDescriptionTest Case
full qualified name
location
research/cultivate/smelldetectorsandmetrics_v0_3m2.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019