Prioritization of Classes for Refactoring
Ruchika Malhotra, Anuradha Chug, Priyanka Khosla · 2015
Bad Smells are certain structures in the software which violates the design principles and ruin the software quality. In order to deals with the bad smells, often refactoring treatment is provided in the code which further improves the software quality. However, it's not possible to refactor each and every class of the software in maintenance phase due to certain deadlines. Prioritization of classes helps the developer to identify the software portions requiring urgent refactoring. In the current study, we propose a framework to identify the potential classes which immediately require refactoring based on the bad smells as well as design characteristics. We evaluate our approach on medium sized open-source systems ORDrumbox. Four types of code-smells Feature Envy, Long Method, God Class and Type Checking were identified and well known Chidamber and Kemerer metric suite is used to evaluate the object oriented characteristics. Both are combined in certain ratio to calculate new proposed metric Quality Depreciation Index Rule (QDIR) for each class. Classes are further arranged as per their QDIR values to identify the severely affected classes requiring immediate refactoring treatment. This study works on 80:20 principles conveying 80% of the code quality can be improved by just providing refactoring treatment to 20% of the severely affected classes. Results reflects that the bad smells and design metrics can be used as an important source of information to quantify the flaws in the classes, thus helpful to maintainers in performing their task under strict time constraints while maintaining the overall software quality.