Cohesion and Norm Enforcement. Cohesion = Norm Enforcement EGSocial Capital EGCollective Efficacy.
Utilization of Method Graphs to Measure Cohesion in Object Oriented Software
-
Upload
atakan-aral -
Category
Software
-
view
108 -
download
0
description
Transcript of Utilization of Method Graphs to Measure Cohesion in Object Oriented Software
![Page 1: Utilization of Method Graphs to Measure Cohesion in Object Oriented Software](https://reader033.fdocuments.us/reader033/viewer/2022052903/5578f25ed8b42a5c5c8b526f/html5/thumbnails/1.jpg)
Utilization of Method Graphs to Measure Cohesion in Object Oriented Software
Atakan Aral, Tolga Ovatman
Istanbul Technical UniverstiyFaculty of Computer and Informatics
![Page 2: Utilization of Method Graphs to Measure Cohesion in Object Oriented Software](https://reader033.fdocuments.us/reader033/viewer/2022052903/5578f25ed8b42a5c5c8b526f/html5/thumbnails/2.jpg)
Outline
• Introduction
• Motivation
• Contribution
• Method Graphs
• Clustering & Similarity Measurement
• Results & Discussion
• Conclusion
• Future Work
![Page 3: Utilization of Method Graphs to Measure Cohesion in Object Oriented Software](https://reader033.fdocuments.us/reader033/viewer/2022052903/5578f25ed8b42a5c5c8b526f/html5/thumbnails/3.jpg)
Introduction
• Cohesion is the harmony of software components in performing responsibilities
• Hard to measure quantitatively
• Cohesion of a class is usually measured by examining common data usage of its methods
![Page 4: Utilization of Method Graphs to Measure Cohesion in Object Oriented Software](https://reader033.fdocuments.us/reader033/viewer/2022052903/5578f25ed8b42a5c5c8b526f/html5/thumbnails/4.jpg)
Motivation
• Conventional techniques analyze object code and require compilation
• Hard to detect data usage from source code
– Indirect ways to access a variable
• Prevents evaluating incomplete code
• Our aim is to derive a pure source code based cohesion measure
![Page 5: Utilization of Method Graphs to Measure Cohesion in Object Oriented Software](https://reader033.fdocuments.us/reader033/viewer/2022052903/5578f25ed8b42a5c5c8b526f/html5/thumbnails/5.jpg)
Contribution
Source Code Parsing
•Abstract Syntax tree based Java Parser
Graph Extraction
•Java Universal Network/Graph
Graph Clustering
•Weak Component Clustering
Similarity Measurement
•Adjusted Rand Index
Correlation Analysis
•Pearson Correlation
• A cohesion measure that
– depends purely on static analysis
– considers only method-to-method relations
– is graph based and software-wide
– is highly correlated to LCOM metric
![Page 6: Utilization of Method Graphs to Measure Cohesion in Object Oriented Software](https://reader033.fdocuments.us/reader033/viewer/2022052903/5578f25ed8b42a5c5c8b526f/html5/thumbnails/6.jpg)
Method Graphs
• Cooperating Methods (CM) relation
– involves method couples that are called together from another host method.
Class A{
MA1(){
MA2();
B.MB();
}
MA2(){
B.MB();
MA3();
MA4();
}
MA3(){}
MA4(){}
}
MB
MA1MA2
MA3
MA4
![Page 7: Utilization of Method Graphs to Measure Cohesion in Object Oriented Software](https://reader033.fdocuments.us/reader033/viewer/2022052903/5578f25ed8b42a5c5c8b526f/html5/thumbnails/7.jpg)
Method Graphs
• Method Call (MC) relation
– involves method couples that call one another.
Class A{
MA1(){
MA2();
B.MB();
}
MA2(){}
MA3(){
MA4();
}
MA4(){
MA1();
}
}
MB
MA1MA2
MA3
MA4
![Page 8: Utilization of Method Graphs to Measure Cohesion in Object Oriented Software](https://reader033.fdocuments.us/reader033/viewer/2022052903/5578f25ed8b42a5c5c8b526f/html5/thumbnails/8.jpg)
Method Graphs
• Method Layout (ML) relation
– involves method couples that are in the same class.
Class A{
MA1(){}
MA2(){}
MA3(){}
MA4(){}
}
Class B{
MB1(){}
MB2(){}
}
MA1
MA1MA2
MB1
MA4
MB2
![Page 9: Utilization of Method Graphs to Measure Cohesion in Object Oriented Software](https://reader033.fdocuments.us/reader033/viewer/2022052903/5578f25ed8b42a5c5c8b526f/html5/thumbnails/9.jpg)
Method Graphs
• Internal Call (IC) relation
– involves method couples that call one anotherand are in the same class.
Class A{
MA1(){
MA2();
B.MB();
}
MA2(){}
MA3(){
MA4();
}
MA4(){
MA1();
}
}
MB
MA1MA2
MA3
MA4
![Page 10: Utilization of Method Graphs to Measure Cohesion in Object Oriented Software](https://reader033.fdocuments.us/reader033/viewer/2022052903/5578f25ed8b42a5c5c8b526f/html5/thumbnails/10.jpg)
Clustering & Similarity
• 4 graphs are clustered using Weak Component Clustering
• 6 clustering couples are compared using adjusted Rand index
– CM—MC: Are the methods calling each other, also called together from another body?
– IC—ML: What is the level of fragmentation within classes?
![Page 11: Utilization of Method Graphs to Measure Cohesion in Object Oriented Software](https://reader033.fdocuments.us/reader033/viewer/2022052903/5578f25ed8b42a5c5c8b526f/html5/thumbnails/11.jpg)
Results & Discussion
• 14 most popular open-source Java projects from GitHub and SourceForge
![Page 12: Utilization of Method Graphs to Measure Cohesion in Object Oriented Software](https://reader033.fdocuments.us/reader033/viewer/2022052903/5578f25ed8b42a5c5c8b526f/html5/thumbnails/12.jpg)
Results & Discussion
![Page 13: Utilization of Method Graphs to Measure Cohesion in Object Oriented Software](https://reader033.fdocuments.us/reader033/viewer/2022052903/5578f25ed8b42a5c5c8b526f/html5/thumbnails/13.jpg)
Results & Discussion
• Calling two methods, that call each other, from the body of another method, decreases the overall cohesion of software
![Page 14: Utilization of Method Graphs to Measure Cohesion in Object Oriented Software](https://reader033.fdocuments.us/reader033/viewer/2022052903/5578f25ed8b42a5c5c8b526f/html5/thumbnails/14.jpg)
Conclusion
• We suggest a novel technique that allowsto measure software-wide cohesion.
• It uses static source code analysis.
• Results indicate that its correlation to LCOM HS is 77%.
![Page 15: Utilization of Method Graphs to Measure Cohesion in Object Oriented Software](https://reader033.fdocuments.us/reader033/viewer/2022052903/5578f25ed8b42a5c5c8b526f/html5/thumbnails/15.jpg)
Future Work
• to adapt our measure to class level
• to use direction—weight data to improve accuracy
• to build a mathematical basis for the relation between our measure and the LCOM metric
• to study on the other correlated groups
![Page 16: Utilization of Method Graphs to Measure Cohesion in Object Oriented Software](https://reader033.fdocuments.us/reader033/viewer/2022052903/5578f25ed8b42a5c5c8b526f/html5/thumbnails/16.jpg)
Thank you!