Measuring Class Cohesion Based on Client Similarities Between Method Pairs: An Improved Approach That Supports Refactoring
Class cohesion is an important quality attribute that has an impact on other quality attributes such understandability, testability, and maintainability. Therefore, classes with low cohesion should be refactored in order to improve their overall qualities. Many cohesion metrics have been introduced...
Main Author: | |
---|---|
Format: | Article |
Language: | English |
Published: |
IEEE
2020-01-01
|
Series: | IEEE Access |
Subjects: | |
Online Access: | https://ieeexplore.ieee.org/document/9300041/ |
id |
doaj-37112772cb824091852f0575d204c15c |
---|---|
record_format |
Article |
spelling |
doaj-37112772cb824091852f0575d204c15c2021-03-30T04:22:28ZengIEEEIEEE Access2169-35362020-01-01822790122791410.1109/ACCESS.2020.30461099300041Measuring Class Cohesion Based on Client Similarities Between Method Pairs: An Improved Approach That Supports RefactoringMusaad Alzahrani0https://orcid.org/0000-0002-6585-4483Department of Computer Science, Albaha University, Albaha, Saudi ArabiaClass cohesion is an important quality attribute that has an impact on other quality attributes such understandability, testability, and maintainability. Therefore, classes with low cohesion should be refactored in order to improve their overall qualities. Many cohesion metrics have been introduced in the literature to automatically assess the quality of the class and support refactoring activities. Most existing metrics measure the class cohesion based on how the methods of a class are internally related to each other, while a few metrics measure the class cohesion based on how the methods are externally used by the clients of the class. Unfortunately, the existing client-based cohesion metrics cannot automatically support refactoring techniques such as the Extract Class refactoring. Therefore, this article proposes a new client-based cohesion metric that can be used to automatically identify Extract Class refactoring opportunities. The proposed metric is theoretically evaluated by proving the compliance of the metric to the mathematical cohesion properties, while it is empirically evaluated by conducting a large case study on three systems to compare the metric with other cohesion metrics. Finally, the paper introduces and evaluates an Extract Class refactoring approach based the proposed cohesion metric.https://ieeexplore.ieee.org/document/9300041/Software engineeringsoftware measurementcohesion metricscode refactoring |
collection |
DOAJ |
language |
English |
format |
Article |
sources |
DOAJ |
author |
Musaad Alzahrani |
spellingShingle |
Musaad Alzahrani Measuring Class Cohesion Based on Client Similarities Between Method Pairs: An Improved Approach That Supports Refactoring IEEE Access Software engineering software measurement cohesion metrics code refactoring |
author_facet |
Musaad Alzahrani |
author_sort |
Musaad Alzahrani |
title |
Measuring Class Cohesion Based on Client Similarities Between Method Pairs: An Improved Approach That Supports Refactoring |
title_short |
Measuring Class Cohesion Based on Client Similarities Between Method Pairs: An Improved Approach That Supports Refactoring |
title_full |
Measuring Class Cohesion Based on Client Similarities Between Method Pairs: An Improved Approach That Supports Refactoring |
title_fullStr |
Measuring Class Cohesion Based on Client Similarities Between Method Pairs: An Improved Approach That Supports Refactoring |
title_full_unstemmed |
Measuring Class Cohesion Based on Client Similarities Between Method Pairs: An Improved Approach That Supports Refactoring |
title_sort |
measuring class cohesion based on client similarities between method pairs: an improved approach that supports refactoring |
publisher |
IEEE |
series |
IEEE Access |
issn |
2169-3536 |
publishDate |
2020-01-01 |
description |
Class cohesion is an important quality attribute that has an impact on other quality attributes such understandability, testability, and maintainability. Therefore, classes with low cohesion should be refactored in order to improve their overall qualities. Many cohesion metrics have been introduced in the literature to automatically assess the quality of the class and support refactoring activities. Most existing metrics measure the class cohesion based on how the methods of a class are internally related to each other, while a few metrics measure the class cohesion based on how the methods are externally used by the clients of the class. Unfortunately, the existing client-based cohesion metrics cannot automatically support refactoring techniques such as the Extract Class refactoring. Therefore, this article proposes a new client-based cohesion metric that can be used to automatically identify Extract Class refactoring opportunities. The proposed metric is theoretically evaluated by proving the compliance of the metric to the mathematical cohesion properties, while it is empirically evaluated by conducting a large case study on three systems to compare the metric with other cohesion metrics. Finally, the paper introduces and evaluates an Extract Class refactoring approach based the proposed cohesion metric. |
topic |
Software engineering software measurement cohesion metrics code refactoring |
url |
https://ieeexplore.ieee.org/document/9300041/ |
work_keys_str_mv |
AT musaadalzahrani measuringclasscohesionbasedonclientsimilaritiesbetweenmethodpairsanimprovedapproachthatsupportsrefactoring |
_version_ |
1724181853932355584 |