Presentation M5 v2 Pptx

download Presentation M5 v2 Pptx

of 21

Transcript of Presentation M5 v2 Pptx

PowerPoint Presentation

Correlation of External Metric with Internal Metrics of QMOOD SOEN-6611 (Software Measurement ) Submitted to : Prof. Nikolaos Tsantalis Presented By: Team DOUTLINE

INTRODUCTIONHYPOTHESIS9 INTERNAL METRICS1 EXTERNAL METRIC MAINTAINABILITYASSUMPTIONSCHALLENGESCORRELATIONLINEAR REGRESSIONUNIVARIATE REGRESSION

Introduction

Type of Study Type 1 (Correlation between metrics)

Project JfreeChart (versions- 1.0.11 to 1.0.18)

Metrics Implemented Internal metrics of QMOOD(CACM, MOA,MFA,ANA, DAM,DCC, NOP, CIS and NOM) and one External metric(Maintainability).

Tools Used - Kalimatrix Logiscope, CKJM, Eclipse, Jdeodarant, SPSS tool and Rstudio. HypothesisCACM(Cohesion among methods of classes) affects maintainability negatively.

MOA(Measure of Aggregation) affects maintainability positively.

MFA(Measure of Functional Abstraction) affects maintainability in a negative way as it leads to reduction in duplicate code.

ANA(Average number of Ancestors) affects maintainability negatively as it also leads to decrease in code duplication.

DAM(Data Access metrics) affects maintainability in positive way.

DCC(Direct Class Coupling) affects maintainability in positive way.

NOP(Number of Polymorphic methods) affects maintainability positively.

CIS(Class Interface size) affects maintainability in a negative way.

NOM(Number of Methods) affects maintainability positively.

Internal MetricsCACM(Cohesion among methods of classes)

Computes the relatedness among methods of a class.It is computed based on the parameter Occurrence Metrix-

where k is the number of methods in a classand l is the number of the distinct parameter types

MOA(Measure of Aggregation)

MOA counts of the part whole relationships realized by attributes.It is a count of the number of data declarations (class fields) whose types are user defined classes.

MFA(Measure of Functional Abstraction)

MFA gives the ratio of the number of inherited methods by a class to the total number of local methods in the class (inherited + defined). (Range 0 to 1)

ANA(Average number of Ancestors)

This metric calculates the number of classes from which a class inherits information. This metric is equivalent to DIT (Depth of Inheritance Tree) from Chidamber and Kemerer.

DAM(Data Access metrics)

This metric calculates The ratio of the number of private (protected) attributes to the total number of attributes declared in the class.

DCC(Direct Class Coupling)

This metric counts the different number of classes that a class is directly related to (by attribute declarations and parameters).

NOP(Number of Polymorphic methods)

NOP counts the number of abstract method in a class.

CIS(Class Interface size)

CIS keeps a count of the number of public methods in a class.

NOM(Number of Methods)

This metric generates a count of all the methods defined in a class.

EXTERAL METRIC

MAINTAINABILITY = ANALYZABILITYc + CHANGEABILITYc + STABILITYc + TESTABILITYc

FACTORFORMULAANALYZIBILITYcl_wmc + cl_comf + in_bases + cu_cdusedWeighted method per class+ Common rate* + Number of direct used classes . Note: *Common rate = Number of comment /Lines of code.CHANGEABILITYcl_stat + cl_func + cl_dataNumber of statements + Total number of methods + Total Number of attributes.TESTABILITYcl_wmc + cl_func + cu_cdusedWeighted methods per class + Total number of method inside the class + Number of direct used classes.STABILITYcl_data_publ + cu_cdusers + in_noc + cl_func_publPublic attribute + Number of direct used classes + Number of children + Number of public method.ASSUMPTIONS

For computing the NOH metric, we assumed that if there is a same superclass for multiple classes then it will be counted only once for calculating number of hierarchies.

For computing the CACM metric, we assumed that the constructor is counted in both the number of methods as well as number of distinct parameters in a class.

For calculating the MFA metric, we assumed that constructors are also counted in total number of local methods defined in a class.

Challenges

Challenges during implementation of metrics:-

NOH

To compute the super class for every class. If a class has more than one subclass, then program counts duplicate hierarchy value due to storing superclass object into array. To overcome this issue, we discovered each and every instance of the classes. Using those instances, we checked for superclass and then stored superclass object into set data type which contains no duplicate elements which gives unique number of hierarchy.

NOM and NOP

For calculating NOM and NOP value, we need to take list of methods and constructors defined in a class but package doesnt provide the list.

Adding getMethodList() and getConstructorList() in classObject class.

To be contd.

MFADiscovering the number of inherited methods.

Overcome: To achieve this task, we had to find the super class of that class and compared each superclass method name with the current class method name using a for loop. Received suggestion to use overridesMethod () this gives us the Boolean return type.Check whether super class is null or not.We tried to match the values for MFA. However, they were different. So, we didnt include it in the final document.

ANAFinding the root class. We had to run while loop by passing dynamic super class instance. Overcome: Check whether super class is null or not. If its not null, then we pass the instance in while loop until super class instance become null. Inside while loop, we calculated the counter value in order to get the number of super class.

.CORRELATION

Correlation is computed based on the Pearsons Correlation Coefficient

Formula given by:

It gives us the linear relation between two variables.

CorrelationNegative PositiveNone0.09 to 0.00.0 to 0.09Small0.3 to 0.10.1 to 0.3Medium0.5 to 0.30.3 to 0.5Strong1.0 to 0.50.5 to 1.0Correlation between DCC and Maintainability

.MaintainabilityDCCStrength195.1780.61168STRONG199.870.61028STRONG201.490.60171STRONG203.890.61643MEDIUM202.1950.62034STRONG189.780.62106MEDIUM189.520.5472STRONG189.710.22212SMALLLinear Regression - DCC

Correlation between CIS and Maintainability

.MaintainabilityCISstrength195.1780.89299STRONG199.870.89546STRONG201.490.89908STRONG203.890.90257STRONG202.1950.90267STRONG189.780.90554STRONG189.520.77258STRONG189.710.35313MEDIUMLinear Regression - CIS

Correlation between NOM and Maintainability

.MaintainabilityNOMstrength195.1780.91635STRONG199.870.91901STRONG201.490.92136STRONG203.890.92384STRONG202.1950.92379STRONG189.780.92758STRONG189.520.79142STRONG189.710.36907MEDIUMLinear Regression NOM

Univariate Linear Regression

.Versions/MetricsANADAMDCCCACMMOAMFANOPCISNOMR2JfreeChart 1.0.11F0.3191.98510.6843.3591.4572.3530.6438.0016.7530.989Sig.0.8120.033000.22800.42300JfreeChart 1.0.12F0.4451.78710.8354.0691.7191.5930.4224.6939.2540.989Sig.0.7210.68000.190.0030.51600JfreeChart 1.0.13F0.4241.42310.4655.1184.0281.8530.4525.6277.7230.991Sig.0.7910.146000.04500.50100JfreeChart 1.0.14F0.3641.16211.0384.1563.1681.6490.5576.3095.4740.99Sig.0.7790.307000.0760.0010.45600JfreeChart 1.0.15F0.1111.138.7143.7843.9691.520.4926.4514.9280.989Sig.0.9540.33000.0470.0060.48300JfreeChart 1.0.16F0.1181.0796.2662.4038.2941.9330.2783.7497.7680.988Sig.0.9490.375000.00400.59800JfreeChart 1.0.17F0.6970.3371.6490.8195.391.5860.8160.8780.9270.878Sig.0.5540.9860.1450.9170.0210.0030.4430.5950.542JfreeChart 1.0.18F0.5434.780.2760.9820.0115.5890.8190.7811.1940.699Sig.0.65300.9260.5420.91600.4410.7170.26Conclusions

.