SlideShare a Scribd company logo
ACEEE Int. J. on Information Technology, Vol. 02, No. 01, March 2012



       Using PageRank Algorithm to Improve Coupling
                         Metrics
                                      Cheolhyun Park, Junhee Kim, and Eunseok Lee
         Department of Electrical and Computer Engineering, Sungkyunkwan University, Suwon, Republic of Korea
                                      Email: {pch851130, comemail, leees}@skku.edu

Abstract—Existing coupling metrics only use the number of                          II. RELATED WORK AND BACKGROUND
methods invocations, and does not consider the weight of the
methods. Thus, they cannot measure coupling metrics                    A. Structural Coupling Metrics
accurately. In this paper, we measure the weight of methods                Existing coupling metrics only consider the structural
using PageRank algorithm, and propose a new approach to                relationship of software. CBO and COF measures coupling
improve coupling metrics using the weight. We validate the             using call relationship between classes [3, 4, 5]. RFC measures
proposed approach by applying them to several open source              coupling using the number of methods of a class and called
projects. And we measure several coupling metrics using
                                                                       methods of a class [3, 4]. MPC measures coupling using the
existing approach and proposed approach. As a result, the
correlation between change-proneness and improved coupling             number of called methods of a class [6]. DAC measures
metrics were significantly higher than existing coupling               coupling using the number of class variables defined in a
metrics. Hence, our improved coupling metrics can more                 class [6]. In this paper, we improve four coupling metrics
accurately measure software.                                           (CBO, MPC, RFC, and COF). Since these coupling metrics is
                                                                       directly consider the number of methods invocations, we
Index Terms—software quality metrics, coupling metrics,                select these metrics.
PageRank algorithm
                                                                       B. Semantic Coupling Metrics
                         I. INTRODUCTION                                   Structural metrics only measures coupling from a data-
                                                                       flow perspective. Semantic metrics can measure coupling from
    Software quality measurement is essential in software
                                                                       a semantic perspective, such as functional. CoCC (Conceptual
engineering. Coupling of software quality metrics is “the
                                                                       Coupling of a Class) measures coupling using conceptual
measure of the strength of association established by a
                                                                       similarity between elements of source code [7]. RTC (Relational
connection from one module to another” [1]. Coupling is
                                                                       Topic based Coupling) measure coupling using Relational
used for various purposes, such as modularization, reusability,
                                                                       Topic Models, generative probabilistic to capture latent
fault-proneness, and change-proneness. In this paper, we
                                                                       topics in source code [8]. Since semantic metrics is only
propose a new approach to improve coupling metrics. Existing
                                                                       applicable to source code, these are not applicable to artifacts
coupling metrics mainly use the number of method
                                                                       (i.e., method call graph) in design phase. In this paper, we
invocations [2]. These coupling metrics does not consider
                                                                       introduce a new approach to improve coupling metrics that
the weight of methods; assume that all methods have same
                                                                       are applicable to artifacts in design phase.
weight. But since there are any methods that are more
important than other methods, considering the weight of                C. PageRank Algorithm
methods is more accurate. In this paper, we measure the weight             PageRank is link analysis algorithm that assigns a
of methods using PageRank algorithm, and propose a new                 numerical weighting to each element of a hyperlinked set of
approach to improve coupling metrics using the weight. We              documents, such as the World Wide Web [9]. In this paper,
validate the proposed approach by applying them to several             we measure weight of methods using PageRank algorithm.
open source projects. And we measure several coupling                  Equation (1) shows that calculation method of PageRank
metrics using existing approach and proposed approach. As              algorithm.
a result, the correlation between change-proneness and                    PR(A) = (1-d) + d(PR(T1)/C(T1)+...+PR(Tn)/C(Tn)) (1)
improved coupling metrics were significantly higher than
                                                                          d = 0.85
existing coupling metrics. We observed that improved
                                                                          C(Ti) : the number of outbound links on page Ti
coupling metrics could more accurately measure software
quality than existing coupling metrics. The rest of the paper          Figure 1 is webpage link graph that is generated randomly.
is organized as follows. Section 2 describes the existing              This graph contains the nodes (webpages) and edges (link
coupling metrics; In Section 3, we outline our new approach            relationship between webpages). The initial value of
to measure the weight of methods using PageRank algorithm              PageRank for each page is assigned to 0.
for improve coupling metrics. Section 4 presents a case study
as an empirical evaluation of the proposed approach. Section
5 concludes the paper and outlines future research.

                                                                                         Figure 1. Webpage link graph
© 2012 ACEEE                                                      56
DOI: 01.IJIT.02.01. 56
ACEEE Int. J. on Information Technology, Vol. 02, No. 01, March 2012


Since the calculation is an iterative process, the algorithm is
stopped after a given count of iterations or if the PageRank
value differences between iterations are less than predefined
values.
            TABLE I. R ESULTS   OF   PAGERANK ALGORITHM




                                                                                           Figure 3. Class call graph
                                                                          Table 4 shows that weight of three classes were computed
                                                                       based on PageRank algorithm. As mentioned above, we can
                                                                       measure weight of methods and classes using PageRank
                                                                       algorithm.
                  III. PROPOSED APPROACH                                                TABLE IV. WEIGHT   OF   CLASSES

    In this section, we measure the weight of methods using
PageRank algorithm, and improve four coupling metrics using
the measured weight of methods.
A. Measurement of Methods Weight                                       A. Improvement of Coupling Metrics
    In order to measure coupling metrics, figure 2 is method               In this section, coupling metrics can be described by
call graph generated randomly. This graph consists of                  following equations. When we use suffix ‘N’ in each metrics,
nodes(methods) and edges(call relationship between                     it means improved cohesion metrics.
methods).                                                                  1) CBO




                                                                               : The set of called classes of class ‘c’
                                                                              : PageRank of class ‘c’
                                                                          2) MPC


                   Figure 2. Method call graph
We applied Pagerank algorithm to this method call graph.
Table 2 shows that weight of five methods were computed
based on PageRank algorithm.                                                   : The set of called methods of class ‘c’
                 TABLE II. WEIGHT      OF   METHODS                           : PageRank of method ‘m’
                                                                          3) RFC



Table 3 shows methods of each class. We can construct class
call graph using Figure2 and Table 3. Figure 3 shows class
call graph.                                                               : The number of methods of class ‘c’
               TABLE III. METHODS      OF   EACH CLASS                    4) CFO




                                                                         : The number of all classes

© 2012 ACEEE                                                      57
DOI: 01.IJIT.02.01.56
ACEEE Int. J. on Information Technology, Vol. 02, No. 01, March 2012


                                                       TABLE V. OPEN SOURCE PROJECTS




                         IV. CASE STUDY
   We validate the proposed approach by applying them to
four open source projects. Table 5 gives a description of four
open source project.
A. Experimental Process
    1) Java parser generates class information. And we can
measure coupling metrics of each class using created class
information.
    2) Then we count the number of changed lines in each
class. And we computed change-proneness using the number
                                                                                          (a) Robocode 1.3    1.7
of changed lines. In this paper, we define change-proneness
as equation (10) that is independent of source code size.




   3) Finally, we computed Pearson’s correlation coefficient
between change-proneness and coupling metrics, for each
class. Generally, coupling metrics is used as predictor of the
change-proneness of a class[10, 11, 12]. Therefore, in order
to empirically confirm superiority of improved coupling
metrics, we computed correlation coefficient between change-
proneness and coupling metrics.
                                                                                         (b) JHotDraw 7.1     7.5
B. Experimental Results
    We measured four coupling metrics of each class with
existing and proposed approach. And we compute the
correlation coefficient between change-proneness and each
coupling metrics. We show the results of this experiment in
figure 4. In this figure 4, the first bar represents the correlation
coefficient between change-proneness and existing coupling
metrics, and the second bar represents the correlation
coefficient between change-proneness and improved
coupling metrics. In four open source projects, we observed
that the correlation coefficient of all coupling metrics has
been improved. Our improved coupling metrics showed                                        (c) JabRef 1.0    2.7
significantly an improved correlation coefficient as compared
to the existing coupling metrics. Thus, improved coupling
metrics proved to be better predictors than existing coupling
metrics. It can be concluded that improved coupling metrics
is the better metrics.




                                                                                          (d) Heritrix 1.0   1.4

© 2012 ACEEE                                                           58
DOI: 01.IJIT.02.01. 56
ACEEE Int. J. on Information Technology, Vol. 02, No. 01, March 2012


              V. CONCLUSION AND FUTURE WORK                              [5] F. Abreu, M. Goulão, and R. Esteves, “Toward the Design
                                                                         Quality Evaluation of Object-Oriented Software Systems,” Proc.
    In this paper, we measure the weight of methods using                Fifth Int’l Conf. Software Quality, Austin, Texas, Oct. 1995.
PageRank algorithm, and proposed a new approach to                       [6] W. Li and S. Henry, “Object-Oriented Metrics that Predict
improve coupling metrics using the weight. We applied                    Maintainability,” J. Systems and Software, vol. 23, no. 2, pp. 111-
improved coupling metrics to four open source projects,                  122, 1993.
measured the correlation coefficient between change-                     [7] D. Poshyvanyk and A. Marcus, “The Conceptual Coupling
proneness and coupling metrics, and empirically observed                 Metrics for Object Oriented Systems,” Proc. 22nd IEEE
superiority of proposed approach. In the future work, we will            International Conference on Software Maintenance (ICSM’06),
                                                                         2006, pp. 469-478.
explore new approach to measure the weight of source code
                                                                         [8] M. Gethers and D. Poshyvanyk. “Using relational topic
lines, and improve complexity metrics using the weight.                  models to capture coupling among classes in object-oriented
                                                                         software systems.” In ICSM’10, 2010.
                          REFERENCES                                     [9] L. Page, S. Brin, R. Motwani, and T. Winograd, “The PageRank
                                                                         Citation Ranking: Bringing Order to the Web,” Stanford Digital
[1] W. Stevens, G. Myers, and L. Constantine, “Structured
                                                                         Libraries Working Paper, 1998.
Design,” IBM Systems J., vol. 13, no. 2, pp. 115-139, 1974.
                                                                         [10] F. G. Wilkie, B. A. Kitchenham, “Coupling Measures and
[2] L. C. Briand, J. W. Daly, and J. Wüst, “A Unified Framework
                                                                         Change Ripples in C++ Application Software”, published in the
for Coupling Measurement in Object-Oriented Systems,” IEEE
                                                                         proceedings of EASE’99, University of Keele, UK, 1998.
Transactions on Software Engineering, vol. 25, pp. 91-121, 1999.
                                                                         [11] Kagdi H, Gethers M, Poshyvanyk D, Collard M (2010)
[3] S.R. Chidamber and C.F. Kemerer, “Towards a Metrics Suite
                                                                         “Blending conceptual and evolutionary couplings to support change
for Object Oriented Design,” A. Paepcke, ed., Proc. Conf. Object-
                                                                         impact analysis in source code”, 17th IEEE Working Conference on
Oriented Programming: Systems, Languages and Applications,
                                                                         Reverse Engineering (WCRE’10). Boston, USA, 119–128.
OOPSLA’ 91, Oct. 1991. Also published in SIGPLAN Notices,
                                                                         [12] R. Robbes, D. Pollet, and M. Lanza. “Logical coupling based
vol. 26, no. 11, pp. 197-211, 1991.
                                                                         on fine-grained change information”, In Proceedings of WCRE 2008
[4] S.R. Chidamber and C.F. Kemerer, “A Metrics Suite for Object
                                                                         (15th Working Conference on Reverse Engineering), 2008.
Oriented Design,” IEEE Trans. Software Eng., vol. 20, no. 6, pp.
476-493, 1994.




© 2012 ACEEE                                                        59
DOI: 01.IJIT.02.01.56

More Related Content

PDF
IRJET- Semantic Analysis of Online Customer Queries
PDF
A Study on Optimization of Top-k Queries in Relational Databases
PDF
International Journal of Computational Engineering Research(IJCER)
PDF
Implementation of query optimization for reducing run time
PDF
A HYBRID CLUSTERING ALGORITHM FOR DATA MINING
PDF
Improving K-NN Internet Traffic Classification Using Clustering and Principle...
PDF
Finding important nodes in social networks based on modified pagerank
PDF
Practical Parallel Hypergraph Algorithms | PPoPP ’20
IRJET- Semantic Analysis of Online Customer Queries
A Study on Optimization of Top-k Queries in Relational Databases
International Journal of Computational Engineering Research(IJCER)
Implementation of query optimization for reducing run time
A HYBRID CLUSTERING ALGORITHM FOR DATA MINING
Improving K-NN Internet Traffic Classification Using Clustering and Principle...
Finding important nodes in social networks based on modified pagerank
Practical Parallel Hypergraph Algorithms | PPoPP ’20

What's hot (9)

PDF
HYBRID GENETIC ALGORITHM FOR BI-CRITERIA MULTIPROCESSOR TASK SCHEDULING WITH ...
PDF
Mining Query Log to Suggest Competitive Keyphrases for Sponsored Search Via I...
PPTX
Collaborative filtering with CCAM
PDF
SIZE ESTIMATION OF OLAP SYSTEMS
PDF
Size estimation of olap systems
PDF
Using transfer learning for video popularity prediction
PDF
mlsys_portrait
DOC
CSE333 project initial spec: Learning agents
PDF
Improved Text Mining for Bulk Data Using Deep Learning Approach
HYBRID GENETIC ALGORITHM FOR BI-CRITERIA MULTIPROCESSOR TASK SCHEDULING WITH ...
Mining Query Log to Suggest Competitive Keyphrases for Sponsored Search Via I...
Collaborative filtering with CCAM
SIZE ESTIMATION OF OLAP SYSTEMS
Size estimation of olap systems
Using transfer learning for video popularity prediction
mlsys_portrait
CSE333 project initial spec: Learning agents
Improved Text Mining for Bulk Data Using Deep Learning Approach
Ad

Viewers also liked (19)

PDF
Different Attacks on Selective Encryption in RSA based Singular Cubic Curve w...
PDF
A Novel Method for Speaker Independent Recognition Based on Hidden Markov Model
PDF
A Quality of Service Strategy to Optimize Bandwidth Utilization in Mobile Net...
PDF
A Robust & Fast Face Detection System
PDF
Towards a Software Framework for Automatic Business Process Redesign
PDF
Detection of Carotid Artery from Pre-Processed Magnetic Resonance Angiogram
PDF
A Dynamic MAC Protocol for WCDMA Wireless Multimedia Networks
DOC
Implementation Adaptive Noise Canceler
DOCX
ACTIVE NOISE CANCELLATION IN A LABORATORY DUCT USING FUZZY LOGIC AND NEURAL ...
PDF
Modified Epc Global Network Architecture of Internet of Things for High Load ...
PDF
Simulation of Adaptive Noise Canceller for an ECG signal Analysis
PDF
Adaptive Digital Filter Design for Linear Noise Cancellation Using Neural Net...
PPTX
ACTIVE NOISE CONTROL FOR A SINGLE TONE
PDF
Noise Cancellation in ECG Signals using Computationally
PPTX
Active Noise Reduction by the Filtered xLMS Algorithm
PPSX
Performance analysis of adaptive noise canceller for an ecg signal
PDF
Power System State Estimation - A Review
PPT
PPTX
ECG Noise cancelling
Different Attacks on Selective Encryption in RSA based Singular Cubic Curve w...
A Novel Method for Speaker Independent Recognition Based on Hidden Markov Model
A Quality of Service Strategy to Optimize Bandwidth Utilization in Mobile Net...
A Robust & Fast Face Detection System
Towards a Software Framework for Automatic Business Process Redesign
Detection of Carotid Artery from Pre-Processed Magnetic Resonance Angiogram
A Dynamic MAC Protocol for WCDMA Wireless Multimedia Networks
Implementation Adaptive Noise Canceler
ACTIVE NOISE CANCELLATION IN A LABORATORY DUCT USING FUZZY LOGIC AND NEURAL ...
Modified Epc Global Network Architecture of Internet of Things for High Load ...
Simulation of Adaptive Noise Canceller for an ECG signal Analysis
Adaptive Digital Filter Design for Linear Noise Cancellation Using Neural Net...
ACTIVE NOISE CONTROL FOR A SINGLE TONE
Noise Cancellation in ECG Signals using Computationally
Active Noise Reduction by the Filtered xLMS Algorithm
Performance analysis of adaptive noise canceller for an ecg signal
Power System State Estimation - A Review
ECG Noise cancelling
Ad

Similar to Using PageRank Algorithm to Improve Coupling Metrics (20)

PDF
IMPLEMENTATION OF DYNAMIC COUPLING MEASUREMENT OF DISTRIBUTED OBJECT ORIENTED...
PDF
IMPLEMENTATION OF DYNAMIC COUPLING MEASUREMENT OF DISTRIBUTED OBJECT ORIENTED...
PDF
Software metrics
PDF
Ijess complimentary copy vol1issue3
PDF
Ijess complimentary copy vol1issue3
PDF
Predicting Defects using Network Analysis on Dependency Graphs
PDF
Writing Maintainable Code
PDF
STIC-D: algorithmic techniques for efficient parallel pagerank computation on...
PDF
Changes and Bugs: Mining and Predicting Development Activities
DOC
Coupling based structural metrics for measuring the quality of a software (sy...
PDF
Efficient call path detection for android os size of huge source code
PDF
EFFICIENT CALL PATH DETECTION FOR ANDROID-OS SIZE OF HUGE SOURCE CODE
PPT
Impact of design complexity on software quality - A systematic review
PDF
Metrics - Using Source Code Metrics to Predict Change-Prone Java Interfaces
DOCX
Final Report
PDF
Dr. Searcher and Mr. Browser: A unified hyperlink-click graph
PPTX
OOAD - Ch.09 - Software Project Estimation.pptx
PDF
An Efficient Cloud based Approach for Service Crawling
PDF
Not Only Statements: The Role of Textual Analysis in Software Quality
PPT
IMPLEMENTATION OF DYNAMIC COUPLING MEASUREMENT OF DISTRIBUTED OBJECT ORIENTED...
IMPLEMENTATION OF DYNAMIC COUPLING MEASUREMENT OF DISTRIBUTED OBJECT ORIENTED...
Software metrics
Ijess complimentary copy vol1issue3
Ijess complimentary copy vol1issue3
Predicting Defects using Network Analysis on Dependency Graphs
Writing Maintainable Code
STIC-D: algorithmic techniques for efficient parallel pagerank computation on...
Changes and Bugs: Mining and Predicting Development Activities
Coupling based structural metrics for measuring the quality of a software (sy...
Efficient call path detection for android os size of huge source code
EFFICIENT CALL PATH DETECTION FOR ANDROID-OS SIZE OF HUGE SOURCE CODE
Impact of design complexity on software quality - A systematic review
Metrics - Using Source Code Metrics to Predict Change-Prone Java Interfaces
Final Report
Dr. Searcher and Mr. Browser: A unified hyperlink-click graph
OOAD - Ch.09 - Software Project Estimation.pptx
An Efficient Cloud based Approach for Service Crawling
Not Only Statements: The Role of Textual Analysis in Software Quality

More from IDES Editor (20)

PDF
Artificial Intelligence Technique based Reactive Power Planning Incorporating...
PDF
Design and Performance Analysis of Genetic based PID-PSS with SVC in a Multi-...
PDF
Optimal Placement of DG for Loss Reduction and Voltage Sag Mitigation in Radi...
PDF
Line Losses in the 14-Bus Power System Network using UPFC
PDF
Study of Structural Behaviour of Gravity Dam with Various Features of Gallery...
PDF
Assessing Uncertainty of Pushover Analysis to Geometric Modeling
PDF
Secure Multi-Party Negotiation: An Analysis for Electronic Payments in Mobile...
PDF
Selfish Node Isolation & Incentivation using Progressive Thresholds
PDF
Various OSI Layer Attacks and Countermeasure to Enhance the Performance of WS...
PDF
Responsive Parameter based an AntiWorm Approach to Prevent Wormhole Attack in...
PDF
Cloud Security and Data Integrity with Client Accountability Framework
PDF
Genetic Algorithm based Layered Detection and Defense of HTTP Botnet
PDF
Enhancing Data Storage Security in Cloud Computing Through Steganography
PDF
Low Energy Routing for WSN’s
PDF
Permutation of Pixels within the Shares of Visual Cryptography using KBRP for...
PDF
Rotman Lens Performance Analysis
PDF
Band Clustering for the Lossless Compression of AVIRIS Hyperspectral Images
PDF
Microelectronic Circuit Analogous to Hydrogen Bonding Network in Active Site ...
PDF
Texture Unit based Monocular Real-world Scene Classification using SOM and KN...
PDF
Mental Stress Evaluation using an Adaptive Model
Artificial Intelligence Technique based Reactive Power Planning Incorporating...
Design and Performance Analysis of Genetic based PID-PSS with SVC in a Multi-...
Optimal Placement of DG for Loss Reduction and Voltage Sag Mitigation in Radi...
Line Losses in the 14-Bus Power System Network using UPFC
Study of Structural Behaviour of Gravity Dam with Various Features of Gallery...
Assessing Uncertainty of Pushover Analysis to Geometric Modeling
Secure Multi-Party Negotiation: An Analysis for Electronic Payments in Mobile...
Selfish Node Isolation & Incentivation using Progressive Thresholds
Various OSI Layer Attacks and Countermeasure to Enhance the Performance of WS...
Responsive Parameter based an AntiWorm Approach to Prevent Wormhole Attack in...
Cloud Security and Data Integrity with Client Accountability Framework
Genetic Algorithm based Layered Detection and Defense of HTTP Botnet
Enhancing Data Storage Security in Cloud Computing Through Steganography
Low Energy Routing for WSN’s
Permutation of Pixels within the Shares of Visual Cryptography using KBRP for...
Rotman Lens Performance Analysis
Band Clustering for the Lossless Compression of AVIRIS Hyperspectral Images
Microelectronic Circuit Analogous to Hydrogen Bonding Network in Active Site ...
Texture Unit based Monocular Real-world Scene Classification using SOM and KN...
Mental Stress Evaluation using an Adaptive Model

Recently uploaded (20)

PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Spectroscopy.pptx food analysis technology
PDF
Encapsulation theory and applications.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Cloud computing and distributed systems.
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Electronic commerce courselecture one. Pdf
PPT
Teaching material agriculture food technology
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
sap open course for s4hana steps from ECC to s4
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Chapter 3 Spatial Domain Image Processing.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Mobile App Security Testing_ A Comprehensive Guide.pdf
Spectroscopy.pptx food analysis technology
Encapsulation theory and applications.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Encapsulation_ Review paper, used for researhc scholars
Cloud computing and distributed systems.
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Programs and apps: productivity, graphics, security and other tools
Electronic commerce courselecture one. Pdf
Teaching material agriculture food technology
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Advanced methodologies resolving dimensionality complications for autism neur...
Network Security Unit 5.pdf for BCA BBA.
Building Integrated photovoltaic BIPV_UPV.pdf

Using PageRank Algorithm to Improve Coupling Metrics

  • 1. ACEEE Int. J. on Information Technology, Vol. 02, No. 01, March 2012 Using PageRank Algorithm to Improve Coupling Metrics Cheolhyun Park, Junhee Kim, and Eunseok Lee Department of Electrical and Computer Engineering, Sungkyunkwan University, Suwon, Republic of Korea Email: {pch851130, comemail, leees}@skku.edu Abstract—Existing coupling metrics only use the number of II. RELATED WORK AND BACKGROUND methods invocations, and does not consider the weight of the methods. Thus, they cannot measure coupling metrics A. Structural Coupling Metrics accurately. In this paper, we measure the weight of methods Existing coupling metrics only consider the structural using PageRank algorithm, and propose a new approach to relationship of software. CBO and COF measures coupling improve coupling metrics using the weight. We validate the using call relationship between classes [3, 4, 5]. RFC measures proposed approach by applying them to several open source coupling using the number of methods of a class and called projects. And we measure several coupling metrics using methods of a class [3, 4]. MPC measures coupling using the existing approach and proposed approach. As a result, the correlation between change-proneness and improved coupling number of called methods of a class [6]. DAC measures metrics were significantly higher than existing coupling coupling using the number of class variables defined in a metrics. Hence, our improved coupling metrics can more class [6]. In this paper, we improve four coupling metrics accurately measure software. (CBO, MPC, RFC, and COF). Since these coupling metrics is directly consider the number of methods invocations, we Index Terms—software quality metrics, coupling metrics, select these metrics. PageRank algorithm B. Semantic Coupling Metrics I. INTRODUCTION Structural metrics only measures coupling from a data- flow perspective. Semantic metrics can measure coupling from Software quality measurement is essential in software a semantic perspective, such as functional. CoCC (Conceptual engineering. Coupling of software quality metrics is “the Coupling of a Class) measures coupling using conceptual measure of the strength of association established by a similarity between elements of source code [7]. RTC (Relational connection from one module to another” [1]. Coupling is Topic based Coupling) measure coupling using Relational used for various purposes, such as modularization, reusability, Topic Models, generative probabilistic to capture latent fault-proneness, and change-proneness. In this paper, we topics in source code [8]. Since semantic metrics is only propose a new approach to improve coupling metrics. Existing applicable to source code, these are not applicable to artifacts coupling metrics mainly use the number of method (i.e., method call graph) in design phase. In this paper, we invocations [2]. These coupling metrics does not consider introduce a new approach to improve coupling metrics that the weight of methods; assume that all methods have same are applicable to artifacts in design phase. weight. But since there are any methods that are more important than other methods, considering the weight of C. PageRank Algorithm methods is more accurate. In this paper, we measure the weight PageRank is link analysis algorithm that assigns a of methods using PageRank algorithm, and propose a new numerical weighting to each element of a hyperlinked set of approach to improve coupling metrics using the weight. We documents, such as the World Wide Web [9]. In this paper, validate the proposed approach by applying them to several we measure weight of methods using PageRank algorithm. open source projects. And we measure several coupling Equation (1) shows that calculation method of PageRank metrics using existing approach and proposed approach. As algorithm. a result, the correlation between change-proneness and PR(A) = (1-d) + d(PR(T1)/C(T1)+...+PR(Tn)/C(Tn)) (1) improved coupling metrics were significantly higher than d = 0.85 existing coupling metrics. We observed that improved C(Ti) : the number of outbound links on page Ti coupling metrics could more accurately measure software quality than existing coupling metrics. The rest of the paper Figure 1 is webpage link graph that is generated randomly. is organized as follows. Section 2 describes the existing This graph contains the nodes (webpages) and edges (link coupling metrics; In Section 3, we outline our new approach relationship between webpages). The initial value of to measure the weight of methods using PageRank algorithm PageRank for each page is assigned to 0. for improve coupling metrics. Section 4 presents a case study as an empirical evaluation of the proposed approach. Section 5 concludes the paper and outlines future research. Figure 1. Webpage link graph © 2012 ACEEE 56 DOI: 01.IJIT.02.01. 56
  • 2. ACEEE Int. J. on Information Technology, Vol. 02, No. 01, March 2012 Since the calculation is an iterative process, the algorithm is stopped after a given count of iterations or if the PageRank value differences between iterations are less than predefined values. TABLE I. R ESULTS OF PAGERANK ALGORITHM Figure 3. Class call graph Table 4 shows that weight of three classes were computed based on PageRank algorithm. As mentioned above, we can measure weight of methods and classes using PageRank algorithm. III. PROPOSED APPROACH TABLE IV. WEIGHT OF CLASSES In this section, we measure the weight of methods using PageRank algorithm, and improve four coupling metrics using the measured weight of methods. A. Measurement of Methods Weight A. Improvement of Coupling Metrics In order to measure coupling metrics, figure 2 is method In this section, coupling metrics can be described by call graph generated randomly. This graph consists of following equations. When we use suffix ‘N’ in each metrics, nodes(methods) and edges(call relationship between it means improved cohesion metrics. methods). 1) CBO : The set of called classes of class ‘c’ : PageRank of class ‘c’ 2) MPC Figure 2. Method call graph We applied Pagerank algorithm to this method call graph. Table 2 shows that weight of five methods were computed based on PageRank algorithm. : The set of called methods of class ‘c’ TABLE II. WEIGHT OF METHODS : PageRank of method ‘m’ 3) RFC Table 3 shows methods of each class. We can construct class call graph using Figure2 and Table 3. Figure 3 shows class call graph. : The number of methods of class ‘c’ TABLE III. METHODS OF EACH CLASS 4) CFO : The number of all classes © 2012 ACEEE 57 DOI: 01.IJIT.02.01.56
  • 3. ACEEE Int. J. on Information Technology, Vol. 02, No. 01, March 2012 TABLE V. OPEN SOURCE PROJECTS IV. CASE STUDY We validate the proposed approach by applying them to four open source projects. Table 5 gives a description of four open source project. A. Experimental Process 1) Java parser generates class information. And we can measure coupling metrics of each class using created class information. 2) Then we count the number of changed lines in each class. And we computed change-proneness using the number (a) Robocode 1.3 1.7 of changed lines. In this paper, we define change-proneness as equation (10) that is independent of source code size. 3) Finally, we computed Pearson’s correlation coefficient between change-proneness and coupling metrics, for each class. Generally, coupling metrics is used as predictor of the change-proneness of a class[10, 11, 12]. Therefore, in order to empirically confirm superiority of improved coupling metrics, we computed correlation coefficient between change- proneness and coupling metrics. (b) JHotDraw 7.1 7.5 B. Experimental Results We measured four coupling metrics of each class with existing and proposed approach. And we compute the correlation coefficient between change-proneness and each coupling metrics. We show the results of this experiment in figure 4. In this figure 4, the first bar represents the correlation coefficient between change-proneness and existing coupling metrics, and the second bar represents the correlation coefficient between change-proneness and improved coupling metrics. In four open source projects, we observed that the correlation coefficient of all coupling metrics has been improved. Our improved coupling metrics showed (c) JabRef 1.0 2.7 significantly an improved correlation coefficient as compared to the existing coupling metrics. Thus, improved coupling metrics proved to be better predictors than existing coupling metrics. It can be concluded that improved coupling metrics is the better metrics. (d) Heritrix 1.0 1.4 © 2012 ACEEE 58 DOI: 01.IJIT.02.01. 56
  • 4. ACEEE Int. J. on Information Technology, Vol. 02, No. 01, March 2012 V. CONCLUSION AND FUTURE WORK [5] F. Abreu, M. Goulão, and R. Esteves, “Toward the Design Quality Evaluation of Object-Oriented Software Systems,” Proc. In this paper, we measure the weight of methods using Fifth Int’l Conf. Software Quality, Austin, Texas, Oct. 1995. PageRank algorithm, and proposed a new approach to [6] W. Li and S. Henry, “Object-Oriented Metrics that Predict improve coupling metrics using the weight. We applied Maintainability,” J. Systems and Software, vol. 23, no. 2, pp. 111- improved coupling metrics to four open source projects, 122, 1993. measured the correlation coefficient between change- [7] D. Poshyvanyk and A. Marcus, “The Conceptual Coupling proneness and coupling metrics, and empirically observed Metrics for Object Oriented Systems,” Proc. 22nd IEEE superiority of proposed approach. In the future work, we will International Conference on Software Maintenance (ICSM’06), 2006, pp. 469-478. explore new approach to measure the weight of source code [8] M. Gethers and D. Poshyvanyk. “Using relational topic lines, and improve complexity metrics using the weight. models to capture coupling among classes in object-oriented software systems.” In ICSM’10, 2010. REFERENCES [9] L. Page, S. Brin, R. Motwani, and T. Winograd, “The PageRank Citation Ranking: Bringing Order to the Web,” Stanford Digital [1] W. Stevens, G. Myers, and L. Constantine, “Structured Libraries Working Paper, 1998. Design,” IBM Systems J., vol. 13, no. 2, pp. 115-139, 1974. [10] F. G. Wilkie, B. A. Kitchenham, “Coupling Measures and [2] L. C. Briand, J. W. Daly, and J. Wüst, “A Unified Framework Change Ripples in C++ Application Software”, published in the for Coupling Measurement in Object-Oriented Systems,” IEEE proceedings of EASE’99, University of Keele, UK, 1998. Transactions on Software Engineering, vol. 25, pp. 91-121, 1999. [11] Kagdi H, Gethers M, Poshyvanyk D, Collard M (2010) [3] S.R. Chidamber and C.F. Kemerer, “Towards a Metrics Suite “Blending conceptual and evolutionary couplings to support change for Object Oriented Design,” A. Paepcke, ed., Proc. Conf. Object- impact analysis in source code”, 17th IEEE Working Conference on Oriented Programming: Systems, Languages and Applications, Reverse Engineering (WCRE’10). Boston, USA, 119–128. OOPSLA’ 91, Oct. 1991. Also published in SIGPLAN Notices, [12] R. Robbes, D. Pollet, and M. Lanza. “Logical coupling based vol. 26, no. 11, pp. 197-211, 1991. on fine-grained change information”, In Proceedings of WCRE 2008 [4] S.R. Chidamber and C.F. Kemerer, “A Metrics Suite for Object (15th Working Conference on Reverse Engineering), 2008. Oriented Design,” IEEE Trans. Software Eng., vol. 20, no. 6, pp. 476-493, 1994. © 2012 ACEEE 59 DOI: 01.IJIT.02.01.56