journal article·2022-11-29Open access

Class-Level Refactoring Prediction by Ensemble Learning with Various Feature Selection Techniques

Rasmita Panigrahi, Sanjay Kumar Kuanar, Sanjay Misra, Lov Kumar

Applied Sciences· Volume 12· Issue 23

Abstract

Background: Refactoring is changing a software system without affecting the software functionality. The current researchers aim i to identify the appropriate method(s) or class(s) that needs to be refactored in object-oriented software. Ensemble learning helps to reduce prediction errors by amalgamating different classifiers and their respective performances over the original feature data. Other motives are added in this paper regarding several ensemble learners, errors, sampling techniques, and feature selection techniques for refactoring prediction at the class level. Objective: This work aims to develop an ensemble-based refactoring prediction model with structural identification of source code metrics using different feature selection techniques and data sampling techniques to distribute the data uniformly. Our model finds the best classifier after achieving fewer errors during refactoring prediction at the class level. Methodology: At first, our proposed model extracts a total of 125 software metrics computed from object-oriented software systems processed for a robust multi-phased feature selection method encompassing Wilcoxon significant text, Pearson correlation test, and principal component analysis (PCA). The proposed multi-phased feature selection method retains the optimal features characterizing inheritance, size, coupling, cohesion, and complexity. After obtaining the optimal set of software metrics, a novel heterogeneous ensemble classifier is developed using techniques such as ANN-Gradient Descent, ANN-Levenberg Marquardt, ANN-GDX, ANN-Radial Basis Function; support vector machine with different kernel functions such as LSSVM-Linear, LSSVM-Polynomial, LSSVM-RBF, Decision Tree algorithm, Logistic Regression algorithm and extreme learning machine (ELM) model are used as the base classifier. In our paper, we have calculated four different errors i.e., Mean Absolute Error (MAE), Mean magnitude of Relative Error (MORE), Root Mean Square Error (RMSE), and Standard Error of Mean (SEM). Result: In our proposed model, the maximum voting ensemble (MVE) achieves better accuracy, recall, precision, and F-measure values (99.76, 99.93, 98.96, 98.44) as compared to the base trained ensemble (BTE) and it experiences less errors (MAE = 0.0057, MORE = 0.0701, RMSE = 0.0068, and SEM = 0.0107) during its implementation to develop the refactoring model. Conclusions: Our experimental result recommends that MVE with upsampling can be implemented to improve the performance of the refactoring prediction model at the class level. Furthermore, the performance of our model with different data sampling techniques and feature selection techniques has been shown in the form boxplot diagram of accuracy, F-measure, precision, recall, and area under the curve (AUC) parameters.
Source: crossref · Quality: baseline

Research context

OpenAlex topics: Software Engineering Research · Software Reliability and Analysis Research · Advanced Malware Detection Techniques

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

Affiliations

Department of Computer Science and Engineering, GIET University, Gunupur 765022, Odisha, India

Department of Computer Science and Communication, Østfold University College, 1757 Halden, Norway

Department of Computer Science and Information System, BITS-Pilani-Hyderabad Campus, Secunderabad 500078, Telangana, India

References (68)

Show source-provided references
1. Architectural Refactoring: A Task-Centric View on Software Evolution10.1109/MS.2015.37 ↗
2. An experimental investigation on the innate relationship between quality and refactoring10.1016/j.jss.2015.05.024 ↗
3. Fowler, M. (2018). Refactoring: Improving the Design of Existing Code, Addison-Wesley Professional.
4. How do I refactor this? An empirical study on refactoring trends and topics in Stack Overflow10.1007/s10664-021-10045-x ↗
5. A cooperative parallel search-based software engineering approach for code-smells detection10.1109/TSE.2014.2331057 ↗
6. Monitor-Based Instant Software Refactoring10.1109/TSE.2013.4 ↗
7. Automatic detection of bad smells in code: An experimental assessment
8. Abdelmoez, W., Kosba, E., and Iesa, A.F. (2014, January 9–11). Risk-based code smells detection tool. Proceedings of the International Conference on Computing Technology and Information Management (ICCTIM), Dubai, United Arab Emirates.
9. Dewangan, S., and Rao, R.S. (2022). Code Smell Detection Using Classification Approaches. Intelligent Systems, Springer.10.1007/978-981-19-0901-6_25 ↗
10. Yordanos, F. (2022). Detecting Code Smells Using Machine Learning Techniques. [Ph.D. Thesis, Debre Birhan University].
11. Kumar, L., Lal, S., Goyal, A., and Murthy, N.B. (2019, January 14–16). Change-proneness of object-oriented software using a combination of feature selection techniques and ensemble learning techniques. Proceedings of the 12th Innovations on Software Engineering Conference (formerly known as India Software Engineering Conference), Pune, India.10.1145/3299771.3299778 ↗
12. A machine learning approach to software model refactoring
13. Constructing models for predicting extract subclass refactoring opportunities using object-oriented quality metrics10.1016/j.infsof.2012.04.004 ↗
14. Kádár, I., Hegedűs, P., Ferenc, R., and Gyimóthy, T. (2016, January 7). A manually validated code refactoring dataset and its assessment regarding software maintainability. Proceedings of the 12th International Conference on Predictive Models and Data Analytics in Software Engineering, Ciudad Real, Spain.10.1145/2972958.2972962 ↗
15. A code is a refactoring dataset and its assessment regarding software maintainability
16. Bashir, R.S., Lee, S.P., Yung, C.C., Alam, K.A., and Ahmad, R.W. (2017, January 18–20). A Methodology for Impact Evaluation of Refactoring on External Quality Attributes of a Software Design. Proceedings of the 2017 International Conference on Frontiers of Information Technology (FIT), Islamabad, Pakistan.10.1109/FIT.2017.00040 ↗
17. Vimaladevi, M., and Zayaraz, G. (2017, January 10–11). Stability Aware Software Refactoring Using Hybrid Search-Based Techniques. Proceedings of the 2017 International Conference on Technical Advancements in Computers and Communications (ICTACC), Melmaurvathur, India.10.1109/ICTACC.2017.18 ↗
18. Krishna, Y., and Alshayeb, M. (2016, January 13–14). An empirical study on the effect of the order of applying software refactoring. Proceedings of the 2016 7th International Conference on Computer Science and Information Technology (CSIT), Amman, Jordan.10.1109/CSIT.2016.7549471 ↗
19. Kaur, G., and Singh, B. (2017, January 15–16). Improving the quality of software by refactoring. Proceedings of the 2017 International Conference on Intelligent Computing and Control Systems (ICICCS), Madurai, India.10.1109/ICCONS.2017.8250707 ↗
20. Malhotra, R., and Chug, A. (2016, January 21–24). An empirical study to assess the effects of refactoring on software maintainability. Proceedings of the 2016 International Conference on Advances in Computing, Communications, and Informatics (ICACCI), Jaipur, India.10.1109/ICACCI.2016.7732033 ↗
21. Desai, A.B., and Parmar, J.K. (2016, January 27–28). Refactoring Cost Estimation (RCE) Model for Object-Oriented System. Proceedings of the 2016 IEEE 6th International Conference on Advanced Computing (IACC), Bhimavaram, India.10.1109/IACC.2016.48 ↗
22. Code smells and refactoring: A tertiary systematic review of challenges and observations10.1016/j.jss.2020.110610 ↗
23. A systematic literature review: Refactoring for disclosing code smells in object oriented software10.1016/j.asej.2017.03.002 ↗
24. Case study on software refactoring tactics10.1049/iet-sen.2012.0121 ↗
25. Software refactoring for system modernization10.1109/MS.2018.4321236 ↗
26. An efficient method for assessing the impact of refactoring candidates on maintainability based on matrix computation10.1109/APSEC.2014.69 ↗
27. Khlif, W., and Ben-Abdallah, H. (July, January 28). Integrating semantics and structural information for BPMN model refactoring. Proceedings of the 2015 IEEE/ACIS 14th International Conference on Computer and Information Science (ICIS), Las Vegas, NV, USA.10.1109/ICIS.2015.7166674 ↗
28. Arcelli, D., Cortellessa, V., and Di Pompeo, D. (May, January 30). Performance-Driven Software Architecture Refactoring. Proceedings of the 2018 IEEE International Conference on Software Architecture Companion (ICSA-C), Seattle, WA, USA.10.1109/ICSA-C.2018.00006 ↗
29. Tao, B., and Qian, J. (October, January 29). Refactoring concurrent java programs based on synchronization requirement analysis. Proceedings of the 2014 IEEE International Conference on Software Maintenance and Evolution, Victoria, BC, Canada.10.1109/ICSME.2014.58 ↗
30. Singh, N.K., Aït-Ameur, Y., and Mery, D. (2018, January 12–14). Formal ontology-driven model refactoring. Proceedings of the 2018 23rd International Conference on Engineering of Complex Computer Systems (ICECCS), Melbourne, Australia.10.1109/ICECCS2018.2018.00022 ↗
31. Tarwani, S., and Chug, A. (2016, January 21–24). Sequencing of refactoring techniques by Greedy algorithm for maximizing maintainability. Proceedings of the 2016 International Conference on Advances in Computing, Communications, and Informatics (ICACCI), Jaipur, India.10.1109/ICACCI.2016.7732243 ↗
32. Automated behavioral testing of refactoring engines10.1109/TSE.2012.19 ↗
33. Automatic Software Refactoring via Weighted Clustering in Method-Level Networks10.1109/TSE.2017.2679752 ↗
34. Refactoring Inspection Support for Manual Refactoring Edits10.1109/TSE.2017.2679742 ↗
35. An automated extract method refactoring approach to correct the long method code smell10.1016/j.jss.2022.111221 ↗
36. Alton, N., and Batory, D. (2022). On Proving the Correctness of Refactoring Class Diagrams of MDE Metamodels. ACM Trans. Softw. Eng. Methodol.10.1145/3549541 ↗
37. Leandro, O., Gheyi, R., Teixeira, L., Ribeiro, M., and Garcia, A. (2022, January 5–7). A Technique to Test Refactoring Detection Tools. Proceedings of the XXXVI Brazilian Symposium on Software Engineering, Virtual Event Brazil.10.1145/3555228.3555246 ↗
38. Improving use case specifications using refactoring10.1109/TLA.2015.7106367 ↗
39. Refactoring for Asynchronous Execution on Mobile Devices10.1109/MS.2015.133 ↗
40. Automated refactoring of OCL constraints with search10.1109/TSE.2017.2774829 ↗
41. Identification, impact, and refactoring of smells in pipe-like web mashups10.1109/TSE.2013.42 ↗
42. Validating the Effectiveness of Object-Oriented Metrics for Predicting Maintainability10.1016/j.procs.2015.07.479 ↗
43. On the documentation of refactoring types10.1007/s10515-021-00314-w ↗
44. Predicting move method refactoring opportunities in object-oriented code10.1016/j.infsof.2017.07.013 ↗
45. Chaparro, O., Bavota, G., Marcus, A., and Di Penta, M. (October, January 29). On the impact of refactoring operations on code quality metrics. Proceedings of the 2014 IEEE International Conference on Software Maintenance and Evolution, Victoria, BC, Canada.10.1109/ICSME.2014.73 ↗
46. Ivers, J., Seifried, C., and Ozkaya, I. (2022, January 12–15). Untangling the Knot: Enabling Architecture Evolution with Search-Based Refactoring. Proceedings of the 2022 IEEE 19th International Conference on Software Architecture (ICSA), Honolulu, HI, USA.10.1109/ICSA53651.2022.00018 ↗
47. Mining commit messages to enhance software refactorings recommendation: A machine learning approach
48. The effectiveness of supervised machine learning algorithms in predicting software refactoring10.1109/TSE.2020.3021736 ↗
49. Kumar, L., and Sureka, A. (2017, January 4–8). Application of LSSVM and SMOTE on seven open-source projects for predicting refactoring at the class level. Proceedings of the 2017 24th Asia-Pacific Software Engineering Conference (APSEC), Nanjing, China.10.1109/APSEC.2017.15 ↗
50. Kumar, L., Satapathy, S.M., and Sureka, A. (2015, January 18–20). Method Level Refactoring Prediction on Five Open Source Java Projects using Machine Learning Techniques. Proceedings of the India Software Engineering Conference, Bangalore, India.
51. An Empirical Study for Method-Level Refactoring Prediction by Ensemble Technique and SMOTE to Improve Its Efficiency10.4018/IJOSSP.287612 ↗
52. (2020, March 20). Data Set for Refactoring Prediction. Available online: https://github.com/rasmitapanigrahi/data-set.
53. Kim, M., Gee, M., Loh, A., and Rachatasumrit, N. (2010, January 7–11). Ref-finder: A refactoring reconstruction tool based on logic query templates. Proceedings of the Eighteenth ACM SIGSOFT International Symposium on Software Engineering Foundations, Santa Fe, NM, USA.10.1145/1882291.1882353 ↗
54. (2020, March 20). Tool for Extracting Source Code Metrics. Available online: https://www.sourcemeter.com/.
55. Alsolai, H., and Roper, M. (2022). The Impact of Ensemble Techniques on Software Maintenance Change Prediction: An Empirical Study. Appl. Sci., 12.10.3390/app12105234 ↗
56. An integrated approach towards automated software requirements elicitation from unstructured documents10.1007/s12652-019-01667-7 ↗
57. A new least squares support vector machines ensemble model for aero engine performance parameter chaotic Prediction10.1155/2016/4615903 ↗
58. Pan, W., Ming, H., Yang, Z., and Wang, T. (2022). Comments on “Using k-core Decomposition on Class Dependency Networks to Improve Bug Prediction Model’s Practical Performance”. IEEE Trans. Softw. Eng., 1.10.1109/TSE.2022.3140599 ↗
59. Sagar, P.S., AlOmar, E.A., Mkaouer, M.W., Ouni, A., and Newman, C.D. (2021). Comparing Commit Messages and Source Code Metrics for the Prediction Refactoring Activities. Algorithms, 14.10.3390/a14100289 ↗
60. Kumar, L., Satapathy, S.M., and Krishna, A. (2018, January 13–16). Applying smote and lssvm with various kernels for predicting refactoring at method level. Proceedings of the International Conference on Neural Information Processing, Siem Reap, Cambodia.10.1007/978-3-030-04221-9_14 ↗
61. Patnaik, A., Panigrahi, R., and Padhy, N. (2020, January 13–14). Prediction Of Accuracy On Open Source Java Projects Using Class Level Refactoring. Proceedings of the 2020 International Conference on Computer Science, Engineering and Applications (ICCSEA), Gunupur, India.10.1109/ICCSEA49143.2020.9132886 ↗
62. Panigrahi, R., Kuanar, S.K., and Kumar, L. (2020, January 13–14). Application of Naïve Bayes classifiers for refactoring Prediction at the method level. Proceedings of the 2020 International Conference on Computer Science, Engineering and Applications (ICCSEA), Gunupur, India.10.1109/ICCSEA49143.2020.9132849 ↗
63. Panigrahi, R., Kunaar, S., and Kumar, L. (2023). Method Level Refactoring Prediction by Weighted-SVM Machine Learning Classifier. Mobile Application Development: Practice and Experience, Springer.10.1007/978-981-19-6893-8_8 ↗
64. Akour, M., Alenezi, M., and Alsghaier, H. (2022). Software Refactoring Prediction Using SVM and Optimization Algorithms. Processes, 10.10.3390/pr10081611 ↗
65. Gerling, J. (2020). Machine Learning for Software Refactoring: A Large-Scale Empirical Study. [Master’s Thesis, Delft University of Technology].
66. Empirical evaluation of software maintainability based on a manually validated refactoring dataset10.1016/j.infsof.2017.11.012 ↗
67. An extensive evaluation of ensemble techniques for software change prediction10.1002/smr.2156 ↗
68. Harnessing deep learning algorithms to predict software refactoring