International Journal of Computer Science and Information Security (IJCSIS),. Vol. 14, No. 7, July 2016. 131 https://sites.google.com/site/ijcsis/. ISSN 1947-5500 ...
International Journal of Computer Science and Information Security (IJCSIS), Vol. 14, No. 7, July 2016
Critical evaluation of Maintainability Parameters using code metrics Bhawana Mathur
Manju Kaushik
Dept. of CS&E JECRC University Jaipur, India
Dept. of CS&E JECRC University Jaipur, India which measures the practicality is known as maintainability index (MI). The maintainability index was given by Oman and Hagemeister and was made out of various software metrics which is the source of software maintainability. It comprises of a polynomial expression and results in a number demonstrating the general framework maintainability. Khan et.al. in their book characterized maintainability index as a gathering of software metrics to be specific Mccabe's Cyclomatic manysided quality (cc), Halstead's volume (v) and lines of code (LOC) that influence maintainability of the product. Maintainability Index might change from new code added to the current source code because of bugs altering or other remedial activities. As indicated by Coleman a Maintainability Index estimation of 85 shows that the product is exceptionally maintainable, an estimation of 85 and 65 moderate maintainability and a quality underneath 65 demonstrates that the framework is hard to keep up [2].The maintainability index (MI) is a generally known as an estimation of maintainability. Run of the mill estimations of maintainability index ranges from 200 to−100s. Higher maintainability index is the reflection of better maintainability. The issue of foreseeing the maintainability of programming has been composed on how maintainability can be anticipated by utilizing different instruments and procedures at the season of planning by reason software design metrics.
Abstract— Software maintenance is a noteworthy feature of software development life cycle, hence earlier approximation of work for maintainability plays a vibrant role. The C sharp small programs are programmed in console applications like a reverse number & check if it a palindrome, check whether given string is a palindrome or not, and so many. The 40 programs on Visual Studio 2012 are compiled and analyze the code metrics. After analysis code metrics parameters like MI, DIT, LOC, class coupling and cyclomatic complexity results are found. Existing approaches for maintainability estimation are the correlation between code metrics like maintainability index, cyclomatic complexity, Depth in Inheritance, class coupling, Line of Code in the experiments. On the off chance that the coefficient quality is in the negative shift, before which it implies the relationship between the variables is adversely associated, or as one worth increases, the different declines ,like Depth of Inheritance between cyclomatic complexity , Depth of Inheritance between class coupling, Lines of Code between Depth of Inheritance, Maintainability Index between Lines of Code. This paper likewise gives various understanding to the viable utilization of Maintainability Index. To reiterate, stay to remark the source codes yet don't put a lot of trust in remarks to enhance maintainability. Keywords- Code Metrics; Maintenance,; Maintainability Index; Lines of Code; Halstead Volume; Cyclomatic Complexity; Depth of Inheritance; Class coupling; smells; Lines of Code (LOC).
Studies have been carrying out to establish a link between object-oriented software metrics and its maintainability. They have also found that these metrics can be used as interpreters of maintenance effort. Exact expectation of software maintainability can be helpful due to the accompanying reasons:
I. INTRODUCTION
In an evolving domain, programming is additionally inclined to software maintainability to adjust programming support is one of the key procedures of the software life cycle. The explanation behind the product updates is to keep programming operation, avert and revise flaws in the product and enhance the usefulness of the product. Support alludes to the alterations made to programming frameworks after their underlying discharge. It is unrealistic to build up a product framework that does not require support since change is the automatic nature of programming frameworks [1]. Maintenance is characterized by the IEEE as "the procedure of changing a product framework or part later conveyance to right blames, show signs of improvement execution or else different Characteristics, adjust to a modified domain". The maintainability is firmly identified. With programming support in light of the fact that the ease with which the maintenance of the framework is performed hence maintainability. There have been numerous endeavors to evaluate the maintainability of a product framework. The generally utilized programming metric
A. It ventures supervisors interestingly the profitability and expenses alongside undertakings. B. It provides managers with information to use beneficial resources in the best way. II. LITERATURE SURVEY
This section intends to highlights a review of the literature on the use of software metrics and maintainability index [2][3][4][5].
Identify applicable sponsor/s here. (sponsors) 131
https://sites.google.com/site/ijcsis/ ISSN 1947-5500
International Journal of Computer Science and Information Security (IJCSIS), Vol. 14, No. 7, July 2016
TABLE I. MAINTAINABILITY
Author Coleman, D., Ash, D., Lowther B. and Oman, P. 1994
Welker, K. D. 2001
Ganpati1, A., Kalia ,A., Singh, H., 2012
SUMMARY
Technique Hierarchical multidimensional assessment models, Polynomial regression models, an aggregate complexity, Principal components analysis, Factor analysis. It comprises of a polynomial expression.
The software metrics were intentional utilizing Resource Standard Metrics (RSM) instrument and Crystal Flow device.
III.
OF
EMPIRICAL
LITERATURE
TABLE II.
ON
Work done They have connected measurements based software maintainability models to 11industrial programming frameworks and utilized the outcomes for actuality finding and choices.
As it was first proposed by Oman and Hagemeister, the MI is contained of weighted Halstead measurements (exertion or volume), McCabe's Cyclomatic Complexity, lines of code (LOC), and then a number of remarks. Two mathematical statements were exhibited: one that considered remarks and another one that did not. In this study, the MI of four furthermost regular OSS specifically Apache, Mozilla Firefox, MySQL and FileZilla for fifty progressive discharges was experimentally inspected. The MI as far as software metrics viz. Lines of Code (LOC), Cyclomatic Complexity (CC), and Halstead Volume (V) was figured for all the fifty progressive adaptations of four OSS.
RESEARCH QUESTIONS
RQ1: What is the use of Minimum and Maximum Value of Maintainability Index? Sol: A high value means better maintainability and minimum value means lower maintainability. RQ2: What is the use of this analysis in these experiments? Sol: So, many researchers work on these fields but we find out better maintainability of object-oriented software like c sharp and the analyses the code metrics. RQ3: Which research methodology is followed in this paper and why? Sol: We use Descriptive Study and Correlation Research Methodology used. For Metrics, that is strongly associated with other, we choose only one of them for further consideration. IV. THE GOAL OF THE STUDY Analysis Code Metrics through object-oriented (C Sharp) Software with the help of Code Metrics to find obtainable better maintainability through various parameters like Maintainability index, LOC, Cyclomatic Complexity, Depth of Inheritance, Class Coupling etc. An unprejudiced approach of this study is to assess maintainability index for comparatively object-oriented C# Experiments and to find out optimizing results with the help of Visual Studio Code Metrics. To evaluate consequences, establish through code metrics and to enhance maintainability, assessing code quality in an objectoriented programming.
CODE METRICS AND EXPERIMENT
Projects
Maintaina -bility Index
Cyclomatic Complexity
Depth of Inheritance
Coupling Class
Lines of Code
E1
15
12
1
2
35
E2
93
7
3
3
11
E3
91
6
2
3
11
E4
91
8
2
4
16
E5
84
8
2
3
18
E6
74
8
1
7
6
E7
67
7
1
12
13
E8
66
14
1
11
11
E9
85
29
1
12
37
E10
72
6
1
8
8
E11
72
6
1
8
8
E12
74
20
1
12
41
E13
72
13
1
2
28
E14
74
2
1
2
9
E15
77
4
1
1
7
E16
68
6
1
3
20
E17
68
4
1
2
12
E18
66
4
1
2
14
E19
68
4
1
2
14
E20
71
5
1
8
15
E21
90
16
1
4
20
E22
86
8
1
3
19
E23
71
2
1
2
10
E24
77
2
1
3
6
E25
68
9
1
2
20
E26
67
5
1
2
14
E27
78
2
1
1
6
E28
60
6
1
8
23
E29
68
3
1
1
18
E30
72
3
1
2
10
E31
65
5
1
1
17
E32
82
4
1
3
9
E33
91
9
1
4
8
E34
91
10
1
4
17
E35
91
10
1
4
17
E36
91
9
1
8
14
E37
85
5
1
1
11
E38
87
8
1
5
16
E39
89
9
1
6
10
E40
90
11
1
9
16
V.RESEARCH METHODOLOGY
The source code of C# 40 Experiments runs in Visual Studio 2012. Discover Code Metrics like parameters Maintainability Index, Depth of Inheritance, Cyclomatic Complexity, Class Coupling and Lines of Code. Descriptive Study and Correlation
Identify applicable sponsor/s here. (sponsors) 132
https://sites.google.com/site/ijcsis/ ISSN 1947-5500
International Journal of Computer Science and Information Security (IJCSIS), Vol. 14, No. 7, July 2016
A. A Number of lines of code (LOC)
Research Methodology is used here. For Metrics, that is strongly associated with other, for further consideration.
It measures the physical size of the system code, barring clear lines and remarks.
A.
Descriptive Methodology A measure of variation (for dispersion) describes the spread or deviation of the individual values around the central value of a set of data.Therefore ,difference sets of data may have the same central value but differ greatly in terms of variation or dispersion. 1) Different measures of variation There are following five different measures of variation : a) b) c) d) e)
B. Cyclomatic Complexity V(g) It was proposed by McCabe, these metrics check the quantity of control flow graph of a project constituent. Cyclomatic complexity worth relies on the quantity of branches created by contingent proclamations (if-then-else). It activities have the structural complexity of the part. C. Maintainability Index (MI)
Range Quartile deviation (or semi- interquartile range) Mean deviation Standard deviation Variance
MI measures maintainability by focusing on the size, the intricacy, and the self-distinction of the code considered. A new maintainability index is obtained after experimentation of the current source code and a product, “new code” is formed. However, since MI depends on its features which are considered as qualities of software. It is similarly autonomous without a doubt; the span of these progressions might be used to analyze frameworks of disparate size. The coefficients of the process for Maintainability Index have been adjusted [8]. On different programming, frameworks kept up by Hewlett-Packard. Maintainability Index defenders confirmed this type of the MI perfect for the mathematical statement. In most cases, modern estimated delicate product frameworks are applied. High MI values show high Maintainability.
B.
Correlation Literally, correlation means an association of two or more facts. In statistics, the correlation may be defined as „the tendency of simultaneous variation between two variables‟. The distribution involving two variables are called bivariate distribution and the distribution involving more than two variables are called multivariate distribution. In statistics, the degree of correlation between two or more variables is studied. Correlation can be defined according to the following points: 1) Measures the relative strength of the linear relationship between two variables. 2) Unit-less. 3) Ranges between –1 and 1. 4) The closer to –1, the stronger the negative linear relationship. 5) The closer to 1, the stronger the positive linear relationship. 6) The closer to 0, the weaker any positive linear relationship VI.
D. Coupling In 1974, Stevens et al. initially characterized Coupling in the setting of organized advancement as "the measure of the quality of affiliations built up by an interface particle from one module to another". Coupling is a measure of association of two items. For instance, objects A and B are coupled if a strategy for questioning A calls a technique or gets to a variable in item B. Classes are coupled when techniques report in one class reported strategies or characteristics of alternate classes. E. The Depth of Inheritance Tree (DIT)
SOURCE CODE MEASUREMENT
The profundity of a class of the legacy progressive system is characterized as the most extreme length of the class hub to the root/guardian of the class order tree and is planned by progenitor classes. In cases including various legacy, the DIT is the most extreme length of the hub to the base of the tree [7]
Run of the mill software metrics is the span of the code (measured in Lines of Code and number of statements) and the code complexity (measured through unpredictability figures like the Cyclomatic Complexity). According to parameters, a result was concluded by code metrics. An arrangement of such cutoff points from various effective system composing rules characterizes a programming standard, i.e., any correlation between these qualities can prompt an agent perspective of the nature of the experimented projects. The metrics considered are among the comprehensive reports and utilized as a part of the information and are as following:
VII.
ANALYSIS, IMPLEMENTATION, AND VALIDATION
In this paper, show the objective to build object-oriented software.
Identify applicable sponsor/s here. (sponsors) 133
https://sites.google.com/site/ijcsis/ ISSN 1947-5500
International Journal of Computer Science and Information Security (IJCSIS), Vol. 14, No. 7, July 2016
TABLE III.
which can be expressed by a straight line is called linear correlation. In perfect linear correlation, the amount of change in one variable bears a constant ratio to the amount of change in the other.
DESCRIPTIVE ANALYSIS OF CODE METRICS
Maintainability Index
Cyclomatic Complexity
Depth of Inheritance
Coupling Class
Lines of Code
Mean
76.18
7.73
1.13
4.50
15.38
Standard Error
2.21
0.83
0.06
0.53
1.29
Median
74.00
6.50
1.00
3.00
14.00
Mode
91.00
6.00
1.00
2.00
11.00
13.95
5.25
0.40
3.37
8.15
194.71
27.59
0.16
11.33
66.50
Kurtosis
8.32
6.25
12.57
-0.06
2.66
Skewness
-2.04
2.10
3.48
1.04
1.58
Range
78.00
27.00
2.00
11.00
35.00
Minimum
15.00
2.00
1.00
1.00
6.00
Maximum
93.00
29.00
3.00
12.00
41.00
Sum
3047.00
309.00
45.00
180.00
615.00
Count
40.00
40.00
40.00
40.00
40.00
Confidence Level (95.0%)
4.46
1.68
0.13
1.08
2.61
Standard Deviation Sample Variance
TABLE V. CORRELATION BETWEEN MAINTAINABILITY INDEX AND CYCLOMATIC COMPLEXITY Maintainability Index
CORRELATION BETWEEN CODE METRICS
Maintainability Index
Cyclomatic Complexity
Depth of Inheritance
Coupling Class
Maintainability Index
1.00
Cyclomatic Complexity
0.11
1.00
Depth of Inheritance
0.32
-0.03
1.00
Coupling Class
0.09
0.60
-0.12
1.00
Lines of Code
-0.30
0.73
-0.08
0.28
1
Cyclomatic Complexity
0.114
1
Figure 1. Correlation between Maintainability Index and Cyclomatic Complexity
VIII.
TABLE IV.
Maintainability Index
Cyclomatic Complexity
Lines of Code
1.00
Co-variation between two variables in opposite direction are negatively correlated with Depth of Inheritance and Cyclomatic Complexity are -0.03, Coupling Class and Depth in Inheritance are -0.12, Lines of code and Maintainability Index are -0.30, as well as Lines of codes and Depth in Inheritance, are -0.08.In the other way, the correlation between the two variables in
SOFTWARE MAINTAINABILITY METRICS HELP IDENTIFY PROBLEM AREAS
Software maintainability needs more workout for the engineer and hence it belongings to the development of software lifecycle. A forty programming has done four sorts of maintenance on new arrangements or upgrades: remedial, versatile, perfective, and deterrent. These moves have made supplementary time to finish if the code is difficult to oversee in any case. A PC program with these capacities requires expanded programming: poor code quality, undetected vulnerabilities, source code imperfections, inordinate specialized multifaceted nature, vast frameworks, defective reported frameworks, over the top dead code. Asset needs to keep on developing as situations turn out to be continuously intricate and applications are immediately created. Software maintainability metrics give a modest, and exact way to deal with identifying conceivable reasons for unmaintainable frameworks. Thus, researcher association gets vision into change regions and can screen basic frameworks in each part its application. The issue of foreseeing the maintainability of programming is largely recognized in the business and much has been composed on how maintainability can be evaluated by utilizing diverse devices. Procedures of the phases of planning with the assistance of software design metrics concentrates on how to manage and find out the firmness of connection between Object Oriented software metrics and its maintainability .They have moreover built up that these metrics can be appropriate as indicators of maintenance effort. Exact
Identify applicable sponsor/s here. (sponsors) 134
https://sites.google.com/site/ijcsis/ ISSN 1947-5500
International Journal of Computer Science and Information Security (IJCSIS), Vol. 14, No. 7, July 2016
compelling methodology. The Maintainability Index gives one little viewpoint of the exceptionally complex issues of Software maintenance.
expectation of software maintainability can be productive in view of the accompanying rationale: 1) It helps project managers in contrast to the productivity and costs of software. 2) It gives managers with information for emphatic designing for the use of valuable resources. IX. DISCUSSION
XI.
The Maintainability Index gives a brilliant manual for direct human examination. This paper gives various considerate to the pragmatic utilization of Maintainability Index. During working in this area of investigation, a lot of scope for future work has been observed. There is need of further empirical investigations to find maintainability index. One technique for testing this objective is by controlled test and investigation. Programming designing endeavors the cost, build dependability, and expansion heartiness and in addition to other things .The objective of this analysis is to grow the establishments of software designing so those work with programming can settle on savvy decisions when fabricating and keep up Systems. Similar Experiments can be carried out for maintainability index. There is in need of further empirical investigations and found Maintainability Index. In this work, Maintainability Index of software is computed based of Cyclomatic Complexity, Lines of Code (LOC), Depth of Inheritance, and Class coupling and their correlation coefficient.
Utilizing the Maintainability Index to survey a source code and is this way distinguish and measure maintainability. It is a powerful approach. The Maintainability Index gives one little point of view of the exceptionally complex issues of software maintenance. The Maintainability Index gives a fabulous manual for direct human examination. This paper gives various updates for generalized utilization of Maintainability Index. To recap, keep on remarking the source codes, however, do not place an excess of confidence in remarks to enhance maintainability. Keep on measuring maintainability utilizing Maintainability Index without translating the outcomes in a vacuum. Know about the confinements of target measurements, for example, MI. While changing advancements it requires evolving measurements. In designing, maintainability it should be kept in mind that deficiencies should overcome in future with regards that it benefit as much as possible from proficiency, dependability, and security, meet new necessities, make future upkeep less demanding, or deal with a changed situation. While designing it should be kept in mind that defective segments should be recovered in spite of substituting newer segments. Utilizing the MI to survey source code and recognizing and measure maintainability is a viable methodology. The maintainability index gives one little point of view of the profoundly complex issues of software maintenance. The MI gives a magnificent manual for direct human examination [6][7][8]. X. RESULT The Maintainability Index of Experiments 40 was practical over statistical tests. The results show that two variables covarying in the same direction are positively correlated i.e. a positive correlation between cyclomatic complexity and maintainability index, Depth of Inheritance and maintainability index, class coupling and maintainability index ,class coupling and cyclomatic complexity lines of codes and cyclomatic complexity and lines of codes and class coupling of code metrics. Similarly, Co-variation between the two variables in opposite direction is negatively correlated. The increase in one variable results in a corresponding decrease in the other .For example, increase in lines of codes results in a corresponding decrease in maintainability index, depth in inheritance and cyclomatic complexity ,class coupling and depth in inheritance as well as lines of codes in code metrics. Maximum the maintainability Index is 93 of experiment 2. Minimum Maintainability Index is 15 of experiment 1 after Statistical analysis of a set of 40 programs in c sharp object-oriented programming. Utilizing the Maintainability Index to evaluate a source code and consequently recognize and measure Maintainability is a
CONCLUSION AND FUTURE SCOPE
ACKNOWLEDGEMENT I am also deeply indebted to JECRC University Foundation who has given me this opportunity to fulfill Ph.D. work. We want to thank JECRC University Foundation for providing their excellent tool freely and their kind helps me for the tool use. REFERENCES [1]
Malhotra R. and Chug A.(2014), “A Metric Suite for Predicting Software Maintainability in Data Intensive Applications”, Kim H.K.,AO S., Amouzegar M.A.(eds.), Transactions on Engineering Technologies , Springer Netherlands, pp. 161-175.
[2]
Kumar L. and Rath S.K.(2015), “Neuro–Genetic Approach for Predicting Maintainability Using Chidamber and Kemerer Software Metrics Suite” , Herwig U., Phayung M., Sirapat B., (eds.),In Recent Advances in Information and Communication Technology, Springer International Publishing, 361,pp. 31-40
[3]
Coleman D., Ash D., Lowther B. and Oman P. (1994), “Using metrics to evaluate software system maintainability, “Computer”, 27(8), pp.44-49.
[4]
Welker K.D., (2001), “The software maintainability index revisited”, CrossTalk , 14, pp.18-21.
[5]
Ganpati A., Kalia A. and Singh H.(2012), “A Comparative Study of Maintainability Index of Open Source Software”, Int. J. Emerg. Technol. Adv. Eng, 2(10), pp.228-230.
[6]
Rivero C.R., Hernandez I., Ruiz D. and Corchuelo R.(2013), “Benchmarking data exchange among semantic-web ontologies”, IEEE Transactions on, Knowledge and Data Engineering, 25(9), pp.1997-2009.
Identify applicable sponsor/s here. (sponsors) 135
https://sites.google.com/site/ijcsis/ ISSN 1947-5500
International Journal of Computer Science and Information Security (IJCSIS), Vol. 14, No. 7, July 2016
[7]
[8]
Coleman D., Lowther B. and Oman P. (1995), “The application of software maintainability models in industrial software systems”, Journal of Systems and Software, 29(1), pp.3-16. Henry S., Humphrey M. and Lewis J. (1990), “Evaluation of the maintainability of object-oriented software”, Liu Y.W.(eds.),10th Conference on Computer and Communication Systems, TENCON'90, Hong Kong, Sept 24-27, 1990. IEEE, pp. 404-409.
AUTHORS PROFILE Authors Profile Bhawana Mathur Bhawana Mathur ,Research Scholar, Dept. of Computer Science and Engineering at JECRC University, Jaipur, Rajasthan, India.She has completed her MCA from IGNOU. Manju Kaushik Dr. Manju Kaushik, Associate Professor, Dept. of Computer Science and Engineering at JECRC University, Jaipur, Rajasthan, India. She has completed her Ph.D. from Mohan Lal Sukhadiya University, Udaipur, Rajasthan, India.
Identify applicable sponsor/s here. (sponsors) 136
https://sites.google.com/site/ijcsis/ ISSN 1947-5500