Title: Combining structural and semantic cohesion measures to identify extract class refactoring

Authors: Mustafa Hammad; Mohammad Alnabhan; Sarah Al-Sarairah

Addresses: Department of Computer Science, Mutah University, 61710 Mutah, Al-Karak, Jordan ' Department of Computer Science, Mutah University, 61710 Mutah, Al-Karak, Jordan ' Department of Computer Science, Mutah University, 61710 Mutah, Al-Karak, Jordan

Abstract: Class cohesion is a major design factor that affects the quality of classes. Classes that have related methods are easy to comprehend and maintain. Classes with many responsibilities are refactored by extracting some methods to new classes. This paper investigates class metrics to identify extract class refactoring opportunities to increase the degree of cohesion. An approach is presented that combines both the structural and the semantic metrics of classes to determine methods that need to be extracted in new classes. A case study is presented to evaluate the proposed approach. The aim of the study is to compare results obtained from applying semantic metrics, structural metrics, and combined metrics together. Results revealed that the proposed approach can provide a valuable set of extract class refactoring suggestions to improve class cohesion.

Keywords: class cohesion; extract class refactoring; SCOM metric; Cosine distance; LOCM metric; Levenshtein distance.

DOI: 10.1504/IJCAT.2019.102841

International Journal of Computer Applications in Technology, 2019 Vol.61 No.3, pp.198 - 206

Received: 20 Jul 2018
Accepted: 21 Nov 2018

Published online: 08 Oct 2019 *

Full-text access for editors Full-text access for subscribers Purchase this article Comment on this article