A User Feedback Centric Approach for Detecting and Mitigating God Class Code Smell Using Frequent Usage Patterns

Code smells are the fragments in the source code that indicates deeper problems in the underlying software design. These code smells can hinder software evolution and maintenance. Out of different code smell types, the God Class (GC) code smell is one of the many important code smells that directly...

Full description

Bibliographic Details
Main Authors: Randeep Singh, Amit Bindal, Ashok Kumar
Format: Article
Language:English
Published: Croatian Communications and Information Society (CCIS) 2019-09-01
Series:Journal of Communications Software and Systems
Subjects:
Online Access:https://jcomss.fesb.unist.hr/index.php/jcomss/article/view/720/pdf
_version_ 1818258320848322560
author Randeep Singh
Amit Bindal
Ashok Kumar
author_facet Randeep Singh
Amit Bindal
Ashok Kumar
author_sort Randeep Singh
collection DOAJ
description Code smells are the fragments in the source code that indicates deeper problems in the underlying software design. These code smells can hinder software evolution and maintenance. Out of different code smell types, the God Class (GC) code smell is one of the many important code smells that directly affects the software evolution and maintenance. The GC is commonly defined as a much larger class in systems that either know too much or do too much as compared to other classes in the system. God Classes are generally accidentally created overtime during software evolution because of the incremental addition of functionalities to it. Generally, a GC indicates a bad design choice and it must be detected and mitigated in order to enhance the quality of the underlying software. However, sometimes the presence of a GC is also considered a good design choice, especially in compiler design, interpreter design and parser implementation. This makes the developer’s feedback important for the correct classification of a class as a GC or a normal class. Therefore, this paper proposes a new approach that detects and proposes refactoring opportunities for GC code smell. The proposed approach makes use of different code metrics in combination along with utilizing user feedback as an important aspect while correctly identifying the GC code smell. The proposed approach that considers combined use of code metrics, is based on two newly proposed code metrics in this paper. The first newly proposed metric is a new approach of measuring the connectivity of a given class with other classes in the system (also termed as coupling). The second newly proposed code metric is proposed to measure the extent to which a given classes make use of foreign member variables. Finally, the proposed approach is also empirically evaluated on two standard open-source commonly used software systems. The obtained result indicates that the proposed approach is capable of correctly identifying the GC code smell.
first_indexed 2024-12-12T17:57:41Z
format Article
id doaj.art-feb4846637be4c62bc08b9e019881a37
institution Directory Open Access Journal
issn 1845-6421
1846-6079
language English
last_indexed 2024-12-12T17:57:41Z
publishDate 2019-09-01
publisher Croatian Communications and Information Society (CCIS)
record_format Article
series Journal of Communications Software and Systems
spelling doaj.art-feb4846637be4c62bc08b9e019881a372022-12-22T00:16:41ZengCroatian Communications and Information Society (CCIS)Journal of Communications Software and Systems1845-64211846-60792019-09-01153245253A User Feedback Centric Approach for Detecting and Mitigating God Class Code Smell Using Frequent Usage PatternsRandeep SinghAmit BindalAshok KumarCode smells are the fragments in the source code that indicates deeper problems in the underlying software design. These code smells can hinder software evolution and maintenance. Out of different code smell types, the God Class (GC) code smell is one of the many important code smells that directly affects the software evolution and maintenance. The GC is commonly defined as a much larger class in systems that either know too much or do too much as compared to other classes in the system. God Classes are generally accidentally created overtime during software evolution because of the incremental addition of functionalities to it. Generally, a GC indicates a bad design choice and it must be detected and mitigated in order to enhance the quality of the underlying software. However, sometimes the presence of a GC is also considered a good design choice, especially in compiler design, interpreter design and parser implementation. This makes the developer’s feedback important for the correct classification of a class as a GC or a normal class. Therefore, this paper proposes a new approach that detects and proposes refactoring opportunities for GC code smell. The proposed approach makes use of different code metrics in combination along with utilizing user feedback as an important aspect while correctly identifying the GC code smell. The proposed approach that considers combined use of code metrics, is based on two newly proposed code metrics in this paper. The first newly proposed metric is a new approach of measuring the connectivity of a given class with other classes in the system (also termed as coupling). The second newly proposed code metric is proposed to measure the extent to which a given classes make use of foreign member variables. Finally, the proposed approach is also empirically evaluated on two standard open-source commonly used software systems. The obtained result indicates that the proposed approach is capable of correctly identifying the GC code smell.https://jcomss.fesb.unist.hr/index.php/jcomss/article/view/720/pdfCode SmellGod ClassRefactoringSoftware EvolutionMaintenanceQuality
spellingShingle Randeep Singh
Amit Bindal
Ashok Kumar
A User Feedback Centric Approach for Detecting and Mitigating God Class Code Smell Using Frequent Usage Patterns
Journal of Communications Software and Systems
Code Smell
God Class
Refactoring
Software Evolution
Maintenance
Quality
title A User Feedback Centric Approach for Detecting and Mitigating God Class Code Smell Using Frequent Usage Patterns
title_full A User Feedback Centric Approach for Detecting and Mitigating God Class Code Smell Using Frequent Usage Patterns
title_fullStr A User Feedback Centric Approach for Detecting and Mitigating God Class Code Smell Using Frequent Usage Patterns
title_full_unstemmed A User Feedback Centric Approach for Detecting and Mitigating God Class Code Smell Using Frequent Usage Patterns
title_short A User Feedback Centric Approach for Detecting and Mitigating God Class Code Smell Using Frequent Usage Patterns
title_sort user feedback centric approach for detecting and mitigating god class code smell using frequent usage patterns
topic Code Smell
God Class
Refactoring
Software Evolution
Maintenance
Quality
url https://jcomss.fesb.unist.hr/index.php/jcomss/article/view/720/pdf
work_keys_str_mv AT randeepsingh auserfeedbackcentricapproachfordetectingandmitigatinggodclasscodesmellusingfrequentusagepatterns
AT amitbindal auserfeedbackcentricapproachfordetectingandmitigatinggodclasscodesmellusingfrequentusagepatterns
AT ashokkumar auserfeedbackcentricapproachfordetectingandmitigatinggodclasscodesmellusingfrequentusagepatterns
AT randeepsingh userfeedbackcentricapproachfordetectingandmitigatinggodclasscodesmellusingfrequentusagepatterns
AT amitbindal userfeedbackcentricapproachfordetectingandmitigatinggodclasscodesmellusingfrequentusagepatterns
AT ashokkumar userfeedbackcentricapproachfordetectingandmitigatinggodclasscodesmellusingfrequentusagepatterns