Out of the 7 projects taken in the research as a case study application, in this section, we will present only Prevayler project analysis.
4.1. The Results of Prevayler Project Analysis
CodeMR results contain graphical and numerical information about the Prevayler project and its packages. The applicable metrics values have been calculated at different levels which are method level, class level, and package level. Figure 8 shows values of some metrics at package level such as (WMC, LOC, #(C&I), AC, EC, and Abs).
Figure 9 shows values of some metrics at class and method level such as (CBO, RFC, DIT, NOC, WMC, LOC, NOF, NOM, LCOM, LCAM, LTCC, ATFD, and SI).
An automated Matlab code has been used to calculate the proposed metrics which are #Aspects, #Pointcuts, #Public Classes, #Pitfalls for Prevayler project that has been shown in Fig. 10.
The CodeMr and Matlab code results have been stored in Microsoft Excel sheets and used in some calculations to find the old reusability values for each package in all projects, which are 7 projects with 62 packages. The SPSS program has been used to analyze the metrics values and study the correlations between them and the old reusability values to get an effect constant for each metric that considered.
After the linear regression has been performed, two important tables have been obtained, the first one is Table 3 which contains the entered and removed metrics, and the second one is Table 5 which contains the effect constant for each metric.
Table 3
The entered and removed metrics.
Variables Entered/Removeda |
Model | Variables Entered | Variables Removed | Method |
1 | # pitfalls, #(C&I), # Aspects, AC, Abs, ATFD, #public classes, LOC, SI, # pointcuts, NOC, NORM, NOM, NOF, DIT, CBO, EC, LTCC, LCOM, RFC, WMC, LCAMb | . | Enter |
a. Dependent Variable: Reusability |
b. All requested variables entered. |
As we note in Table 3 all entered metrics have been entered and not one has been removed which means that all metrics are important. The dependent variable is the old reusability value which has been illustrated as a base to perform the analysis process.
Regression analysis is performed using SPSS tool, where the values of Reusability are used as a dependent variable and the other metrics (Object-oriented and Aspect-oriented metrics) values used as independent variable. The following three tables highlight the results of the regression analysis process. Table 4 shows the values of R (multiple correlation coefficient) and\({R}^{2}\), and the standard error of the estimate that were used to determine how well a regression would fit the data. The value of R in the applications used in this experiment is 1.0. This value indicates a very good level of prediction. The value of \({R}^{2}\) is also 1.0 which means that 100% of the variability observed in the target variable is explained by the regression model.
Table 4
Model summary from SPSS as a result of running the applications.
Model Summary |
Model | R | R Square | Adjusted R Square | Std. Error of the Estimate |
1 | 1.000a | 1.000 | 1.000 | .00004 |
a. Predictors: (Constant), Ptfalls, MC, aspects, AC, ATFD, ABS, LOC, SI, pointcut, NOC, NORM, NOM, DIT, NOF, CBO, EC, LTCC, publcalss, RFC, WMC, LCAM |
Table 5 indicates whether the regression analysis process is a good fit for the data or not. It shows that the independent variables are a statistically significant prediction of dependent variable, where the significant value of is .000 which is less than 0.05. We should mention here that the threshold value for significance is 0.05. If the value of significance is less than 0.5 (p) then we include the value of the referred metrics. Table 6 show the coefficient values for the measured metrics, for the applications.
Table 5
ANOVA Table from SPSS as a result of running the 3 applications
ANOVAa |
Model | Sum of Squares | df | Mean Square | F | Sig. |
1 | Regression | 55119244.211 | 21 | 2624725.915 | 323.500 | .000b |
Residual | .000 | 40 | .000 | | |
Total | 55119244.211 | 61 | | | |
a. Dependent Variable: REusabilty |
b. Predictors: (Constant), Ptfalls, MC, aspects, AC, ATFD, ABS, LOC, SI, pointcut, NOC, NORM, NOM, DIT, NOF, CBO, EC, LTCC, publcalss, RFC, WMC, LCAM |
Table 6 shows that the most influential metrics (based on significant values) are LOC, MC, NOM, NOF, CBO, NOC,EC, ATFD, AC, LTCC,LCAM, publcalss and ABS for which the significant values are less than 0.05. For example, the effect of CBO metric (b=-0.25, p = .000) is significant and its coefficient is negative, indicating that the greater the coupling between objects, the more difficult it is to reuse the system. Table 6 shows effect constant for each metric appears next to it, and the new reusability equation that has been built in the previous section based on the metrics that their (t) value isn’t zero which means it positively or negatively affects the reusability. (LOC, #(C&I), NOM, NOF, and #Public classes) are positively affect reusability by (0.5), (LCOM, LTCC, and LCAM) are positively affect reusability by (0.25), but (CBO, NOC, EC, ATFD, and AC) are negatively affect reusability by (− 0.25).
Table 6
Coefficients table from SPSS as a result of running the three applications
Coefficientsa |
Model | Unstandardized Coefficients | Standardized Coefficients | t | Sig. |
B | Std. Error | Beta |
1 | (Constant) | -1.673E-12 | .000 | | .000 | 1.000 |
LOC | .500 | .000 | .980 | 8646331.266 | .000 |
MC | .500 | .000 | .006 | 91078.270 | .000 |
NOM | .500 | .000 | .103 | 1711845.006 | .000 |
NOF | .500 | .000 | .017 | 769397.630 | .000 |
WMC | 1.221E-13 | .000 | .000 | .000 | 1.000 |
pointcut | 8.858E-12 | .000 | .000 | .000 | 1.000 |
aspects | -9.239E-12 | .000 | .000 | .000 | 1.000 |
CBO | − .250 | .000 | − .093 | -1295393.408 | .000 |
NOC | − .250 | .000 | − .002 | -72371.833 | .000 |
NORM | 6.637E-13 | .000 | .000 | .000 | 1.000 |
SI | -6.383E-12 | .000 | .000 | .000 | 1.000 |
RFC | 1.595E-13 | .000 | .000 | .000 | 1.000 |
DIT | -3.682E-13 | .000 | .000 | .000 | 1.000 |
EC | − .250 | .000 | − .002 | -72774.662 | .000 |
ATFD | − .250 | .000 | − .001 | -21079.380 | .000 |
AC | − .250 | .000 | − .001 | -83342.918 | .000 |
LTCC | .250 | .000 | .001 | 28162.019 | .000 |
LCAM | .250 | .000 | .002 | 18342.768 | .000 |
publcalss | .250 | .000 | .001 | 23113.752 | .000 |
ABS | .500 | .000 | .005 | 681444.787 | .000 |
Ptfalls | 1.702E-12 | .000 | .000 | .000 | 1.000 |
a. Dependent Variable: REusabilty |
The new reusability equation of AOS has been inserted to the excel sheet, and a new reusability value has been calculated for each package as shown in Table 7. There is a difference between the reusability values that indicates the impact of generality and complexity attributes which have been included in the new equation.
Table 7 The old and new AOS reusability values.
The reusability values which have been calculated and appeared for each package in the previous section in Table 6 are divided into two columns; the first one has the old reusability values of AOS, calculated based on Eq. 1 which has been built in the previous studies. The second column has the new reusability values of AOS, calculated based on Eq. 2 which has been proposed in this study. The original attributes that have been included in Eq. 1 have been included in Eq. 2 also. The effect constant for each one has been calculated by finding the average of the affect constants of its metrics that impact it based on SPSS analysis results which are:
-
Coupling has affected by ( EC (− 0.25), ATFD (− 0.25), AC (− 0.25), CBO (− 0.25), NOC (− 0.25)).
-
Cohesion has affected by ( LTCC ( 0.25), LCAM ( 0.25), LCOM ( 0.25)).
-
Messaging has affected by ( #Public classes ( 0.5)).
-
Design size has affected by ( LOC ( 0.5), #(C&I) ( 0.5), NOM ( 0.5), NOF ( 0.5)).
The attributes that have been added to Eq. 2 are complexity which has been affected by (CBO(− 0.25), LCOM(0.25), and NOC (− 0.25)), and generality has an effect on the AOS reusability reached to 0.37 that has evaluated based on two influential metrics which are (#Public classes(0.5), and AC(0.25)), its impact has been calculated according to to find the average of the metrics affect constant values.
These two metrics indicate the popularity degree of the package, because if the number of public classes in the package is high, then this means that the package’s functions are available and ready to be called and illustrated by the external objects, which means that the functions in the package have high expected popularity by the developers who built the system, this result indicates that this package has a high potential for reuse in new systems that have similar functionality, and that makes the reusability of it high. The AC metric has a good positive effect on the generality of the package, because it indicates to the popularity of the package too, if there are many external objects that depend upon the classes in this package, then that means it has a high popularity and generality, which resulting to be with high reusability.
Table 8 shows the correlation coefficient values between reusability and all proposed metrics, based on it there are some metrics that negatively affect the AOS reusability such as #Pointcuts, #Aspects, and Abs which may lead to an increase the complexity and size of software, on the other hand they have a positive impact when may lead to increase cohesion and decrease coupling, other metrics have positive affect on the AOS reusability such as AC (Afferent Coupling) and #Public classes because they may lead to increasing the generality of the component which give it higher ability to be reused, CBO, NOC, and DIT are metrics that have negative effect on reusability because if they are high it leads to increasing the coupling, complexity, and size. So these metrics have an important role in the reusability values difference.
Table 8
The coefficient correlation between reusability and each metric.
The Metric | The metric impact on new reusability |
LOC | 0.996071636 |
#(C&I) | 0.633568573 |
NOM | 0.845762729 |
NOF | 0.801471253 |
# pointcuts | -0.084698476 |
# Aspects | -0.084244047 |
CBO | 0.899260295 |
LCOM | 0.764050092 |
WMC | 0.96575989 |
NOC | 0.509101881 |
NORM | 0.602049373 |
SI | 0.355607905 |
RFC | 0.914884093 |
DIT | 0.554874776 |
EC | 0.555604317 |
ATFD | 0.725972978 |
AC | 0.076133547 |
LTCC | 0.734987037 |
LCAM | 0.699108086 |
#public classes in the package | 0.427785418 |
Abs | -0.133958274 |
# pitfalls | 0.037880461 |
Figure 11 shows the affect strength of each metric on the reusability, and as we note the most significant metrics that positively affect the reusability are (LOC, WMC, CBO, and RFC), and the most significant metric that negatively affects the reusability is (#Public classes), there are some metrics that have a weak impact on the reusability such as (#Pitfalls, AC, #Pointcuts, and #Aspects). Some metrics have been removed during the analysis process that has been performed in SPSS program.