Combining structural and semantic cohesion measures to identify extract class refactoring. (30th September 2019) - Hammad, Mustafa; Alnabhan, Mohammad; Al-Sarairah, Sarah
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.