Generic placeholder image

Recent Advances in Electrical & Electronic Engineering


ISSN (Print): 2352-0965
ISSN (Online): 2352-0973

Review Article

A Review on Machine-learning Based Code Smell Detection Techniques in Object-oriented Software System(s)

Author(s): Amandeep Kaur, Sushma Jain, Shivani Goel and Gaurav Dhiman*

Volume 14, Issue 3, 2021

Published on: 22 September, 2020

Page: [290 - 303] Pages: 14

DOI: 10.2174/2352096513999200922125839

Price: $65


Background: Code smells are symptoms that something may be wrong in software systems that can cause complications in maintaining software quality. In literature, there exist many code smells and their identification is far from trivial. Thus, several techniques have also been proposed to automate code smell detection in order to improve software quality.

Objective: This paper presents an up-to-date review of simple and hybrid machine learning-based code smell detection techniques and tools.

Methods: We collected all the relevant research published in this field till 2020. We extracted the data from those articles and classified them into two major categories. In addition, we compared the selected studies based on several aspects like code smells, machine learning techniques, datasets, programming languages used by datasets, dataset size, evaluation approach, and statistical testing.

Results: A majority of empirical studies have proposed machine-learning based code smell detection tools. Support vector machine and decision tree algorithms are frequently used by the researchers. Along with this, a major proportion of research is conducted on Open Source Softwares (OSS) such as Xerces, Gantt Project and ArgoUml. Furthermore, researchers pay more attention to Feature Envy and Long Method code smells.

Conclusion: We identified several areas of open research like the need for code smell detection techniques using hybrid approaches, the need for employing valid industrial datasets, etc.

Keywords: Code smells, anti-patterns, machine learning, software maintenance, Open Source Softwares (OSS), industrial datasets.

Graphical Abstract
G. Booch, Object oriented analysis & design with application., Pearson Education India, 2006.
A. Kaur, "A systematic literature review on empirical analysis of the relationship between code smells and software quality attributes", Arch. Comput. Methods Eng., vol. 27, pp. 1267-1296, 2019.
M. Tufano, F. Palomba, G. Bavota, R. Oliveto, M. Di Penta, A. De Lucia, and D. Poshyvanyk, "When and why your code starts to smell bad", Proceedings of the 37th International Conference on Software Engineering, pp. 403-414, 2015.
M. Fowler, K. Beck, J. Brant, and W. Opdyke, "Refactoring: improving the design of existing code", 1st ed 2019.
W. Abdelmoez, E. Kosba, and A.F. Iesa, "Risk-based code smells detection tool", The International Conference on Computing Technology and Information Management (ICCTIM), p. 148, 2014.
W.F. Opdyke, "Refactoring object-oriented frameworks"UMI Order No. GAX93-05645., University of Illinois at Urbana-Champaign: Champaign, IL, USA, 1992.
R. Marinescu, "Detection strategies: Metrics-based rules for detecting design flaws", Proceedings of 20th International Conference on Software Maintenance, IEEE, pp. 350-359, 2004.
W.H. Brown, R.C. Malveau, H.W. McCormick, and T.J. Mowbray, AntiPatterns: refactoring software, architectures, and projects in crisis., John Wiley & Sons, Inc., 1998.
N. Fenton, and J. Bieman, Software metrics: a rigorous and practical approach., CRC press, 2014.
M. Mantyla, J. Vanhanen, and C. Lassenius, "A taxonomy and an initial empirical study of bad smells in code", In: International Conference on Software Maintenance (ICMS) Proceedings, 2003pp. 381-384
A. Sabané, M. Di Penta, G. Antoniol, and Y.G. Guéhéneuc, "A study on the relation between antipatterns and the cost of class unit testing", In: 17th European Conference on Software Maintenance and Reengineering (CSMR), 2013pp. 167-176
T. Hall, M. Zhang, D. Bowes, and Y. Sun, "Some code smells have a significant but small effect on faults", ACM Trans. Softw. Eng. Methodol., vol. 23, no. 4, p. 33, 2014.
S. Kaur, and P. Singh, "How does object-oriented code refactoring influence software quality? Research landscape and challenges", J. Syst. Softw., vol. 157, p. 110394, 2019.
N. Chapin, "Do we know what preventive maintenance is?", In: International Conference on Software Maintenance (ICMS), 2000pp. 15-17
G. Rasool, and Z. Arshad, "A review of code smell mining techniques", J. Softw: Evol. Process, vol. 27, no. 11, pp. 867-895, 2015.
M.V. Mäntylä, and C. Lassenius, "Subjective evaluation of software evolvability using code smells: An empirical study", Empir. Softw. Eng., vol. 11, no. 3, pp. 395-431, 2006.
W.C. Wake, Refactoring workbook., Addison-Wesley Professional, 2004.
A. Muth, O. Ragnarsson, G. Johannsson, and B. Wängberg, "Systematic review of surgery and outcomes in patients with primary aldosteronism", Br. J. Surg., vol. 102, no. 4, pp. 307-317, 2015.
[] [PMID: 25605481]
M. Zhang, T. Hall, and N. Baddoo, "Code bad smells: a review of current knowledge", J. Softw. Mainten. Evol: Res. Practice, vol. 23, no. 3, pp. 179-202, 2011.
E. Fernandes, J. Oliveira, G. Vale, T. Paiva, and E. Figueiredo, "A review-based comparative study of bad smell detection tools", In: Proceedings of the 20th International Conference on Evaluation and Assessment in Software Engineering, 2016pp. 1-12
A. Gupta, B. Suri, and S. Misra, "A systematic literature review: Code bad smells in Java source code", In: International Conference on Computational Science and Its Applications, 2017pp. 665-682
T. Sharma, and S. Diomidis, "A survey on software smells", J. Syst. Softw., vol. 138, pp. 158-173, 2018.
S. de Paulo, E. Vicente, A. De Lucia, and M. Marcelo de Almeida, "A systematic literature review on bad smells-5 W’s: which, when, what, who, where", IEEE Trans. Softw. Eng., 2018.
M.S. Haque, J. Carver, and T. Atkison, "Causes, impacts, and detection approaches of code smell: a survey", Proceedings of the ACMSE 2018 Conference, pp. 1-8, 2018.
S. Singh, and S. Kaur, "A systematic literature review: Refactoring for disclosing code smells in object oriented software", Ain Shams Eng. J., vol. 9, no. 4, pp. 2129-2151, 2018.
F.L. Caram, B.R.D.O. Rodrigues, A.S. Campanelli, and F.S. Parreiras, "Machine learning techniques for code smells detection: a systematic mapping study", Int. J. Softw. Eng. Knowl. Eng., vol. 29, no. 2, pp. 285-316, 2019.
A. Kaur, and G. Dhiman, "A review on search-based tools and techniques to identify bad code smells in object-oriented systems"Harmony Search Nature Inspired Optimization Algorithms., Springer, pp. 909-921, 2019.
A. Al-Shaaby, H. Aljamaan, and M. Alshayeb, "Bad smell detection using machine learning techniques: A systematic literature review", Arab. J. Sci. Eng., vol. 45, pp. 2341-2369, 2020.
M.I. Azeem, F. Palomba, L. Shi, and Q. Wang, "Machine learning techniques for code smell detection: A systematic literature review and meta-analysis", Inf. Softw. Technol., vol. 108, pp. 115-138, 2019.
F.A. Fontana, M.V. Mäntylä, M. Zanoni, and A. Marino, "Comparing and experimenting machine learning techniques for code smell detection", Empir. Softw. Eng., vol. 21, no. 3, pp. 1143-1191, 2016.
F.A. Fontana, V. Ferme, M. Zanoni, and A. Yamashita, "Automatic metric thresholds derivation for code smell detection", In: Proceedings of the Sixth International Workshop on Emerging Trends In Software Metrics, 2015pp. 44-53
J. Kreimer, "Adaptive detection of design flaws", Electron. Notes Theor. Comput. Sci., vol. 141, no. 4, pp. 117-136, 2005.
R. Oliveto, F. Khomh, G. Antoniol, and Y-G. Guéhéneuc, "Numerical signatures of antipatterns: An approach based on b-splines", In: 14th European Conference on Software Maintenance and Reengineering, 2010pp. 248-251
N. Moha, Y-G. Gueheneuc, L. Duchien, and A-F. Le Meur, "Decor: A method for the specification and detection of code and design smells", IEEE Trans. Softw. Eng., vol. 36, no. 1, pp. 20-36, 2009.
F. Khomh, S. Vaucher, Y-G. Guéhéneuc, and H. Sahraoui, "A bayesian approach for the detection of code and design smells", In: Ninth International Conference on Quality Software, 2009pp. 305-314
S. Hassaine, F. Khomh, Y-G. Guéhéneuc, and S. Hamel, "Ids: An immune-inspired approach for the detection of software design smells", In: Seventh International Conference on the Quality of Information and Communications Technology, 2010pp. 343-348
N. Maneerat, and P. Muenchaisri, "Bad-smell prediction from software design model using machine learning techniques", In: Eighth International Joint Conference on Computer Science and Software Engineering (JCSSE), 2011pp. 331-336
P. Danphitsanuphan, and T. Suwantada, "Code smell detecting tool and code smell-structure bug relationship"In: 2012 Spring Congress on Engineering and Technology., IEEE, 2011, pp. 1-5.
S. Fu, and B. Shen, "Code bad smell detection through evolutionary data 69 mining", ACM/IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM), pp. 1-9, 2015.
A. A. Rao, and K. N. Reddy, "Detecting bad smells in object oriented design using design change propagation probability matrix 1",
F. Palomba, G. Bavota, M. Di Penta, R. Oliveto, A. De Lucia, and D. Poshyvanyk, "Detecting bad smells in source code using change history information", In: Proceedings of the 28th IEEE/ACM International Conference on Automated Software Engineering, 2013pp. 268-278
F. Palomba, G. Bavota, M. Di Penta, R. Oliveto, D. Poshyvanyk, and A. De Lucia, "Mining version histories for detecting code smells", IEEE Trans. Softw. Eng., vol. 41, no. 5, pp. 462-489, 2014.
F.A. Fontana, M. Zanoni, A. Marino, and M.V. Mäntylä, "Code smell detection: Towards a machine learning-based approach", In: 2013 IEEE International Conference on Software Maintenance, 2013pp. 396-399
D. Di Nucci, F. Palomba, D.A. Tamburri, A. Serebrenik, and A. De Lucia, "Detecting code smells using machine learning techniques: are we there yet?", In: IEEE International Conference on Software Maintenance. IEEE., 2018pp. 396-399
M. Hozano, N. Antunes, B. Fonseca, and E. Costa, "Evaluating the accuracy of machine learning algorithms on detecting code smells for different developers", ICEIS (2), 2017.
F. Pecorelli, F. Palomba, D. Di Nucci, and A. De Lucia, "Comparing heuristic and machine learning approaches for metric-based code smell detection", In: 27th International Conference on Program Comprehension (ICPC), 2019pp. 93-104
X. Wang, Y. Dang, L. Zhang, D. Zhang, E. Lan, and H. Mei, "Can i clone this piece of code here?", In: Proceedings of the 27th IEEE/ACM International Conference on Automated Software Engineering, 2012pp. 170-179
M. White, M. Tufano, C. Vendome, and D. Poshyvanyk, "Deep learning code fragments for code clone detection", In: Proceedings of the 31st IEEE/ACM International Conference on Automated Software Engineering, 2016pp. 87-98
L. Jiang, G. Misherghi, Z. Su, and S. Glondu, "Deckard: Scalable and accurate tree-based detection of code clones", In: Proceedings of the 29th international conference on Software Engineering, 2007pp. 96-105
S. Vaucher, F. Khomh, N. Moha, and Y-G. Guéhéneuc, "Tracking design smells: Lessons from a study of god classes", In: 16th Working Conference on Reverse Engineering, 2009pp. 145-154
F. Khomh, S. Vaucher, Y-G. Guéhéneuc, and H. Sahraoui, "Bdtex: A gqm-based bayesian approach for the detection of antipatterns", J. Syst. Softw., vol. 84, no. 4, pp. 559-572, 2011.
A. Maiga, N. Ali, N. Bhattacharya, A. Sabané, Y-G. Guéhéneuc, G. Antoniol, and E. Aïmeur, "Support vector machines for anti-pattern detection", In: Proceedings of the 27th IEEE/ACM International Conference on Automated Software Engineering. IEEE., 2012pp. 278-281
A. Maiga, N. Ali, N. Bhattacharya, A. Sabane, Y-G. Gueheneuc, and E. Aimeur, "Smurf: A svm-based incremental anti-pattern detection approach", In: 19th Working Conference on Reverse Engineering, 2012pp. 466-475
A. Kaur, S. Jain, and S. Goel, "A support vector machine based approach for code smell detection", In: 2017 International Conference on Machine Learning and Data Science (MLDS), 2017pp. 9-14
L. Amorim, and E. Costa, "Experience report: Evaluating the effectiveness of decision trees for detecting code smells", In: 2015 IEEE 26th International Symposium on Software Reliability Engineering (ISSRE), IEEE., 2015, pp. 261-269.
C.-W. Hsu, C.-C. Chang, and C-J. Lin, A practical guide to support vector classification., National Taiwan University, 2003.
G. Saranya, H.K. Nehemiah, A. Kannan, and V. Nithya, Model level code smell detection using egapso based on similarity measures., Alexandria Eng. J., 2017.
A. Ghannem, G. El Boussaidi, and M. Kessentini, "On the use of design defect examples to detect model refactoring opportunities", Softw. Qual. J., vol. 24, no. 4, pp. 947-965, 2016.
W. Kessentini, M. Kessentini, H. Sahraoui, S. Bechikh, and A. Ouni, "A cooperative parallel search-based software engineering approach for code-smells detection", IEEE Trans. Softw. Eng., vol. 40, no. 9, pp. 841-861, 2014.
U. Mansoor, M. Kessentini, S. Bechikh, and K. Deb, "Code-smells detection using good and bad software design examples", Technical report, Technical Report, 2013.
M. Hadj-Kacem, and N. Bouassida, A hybrid approach to detect code smells using deep learning., ENASE, pp. 137-146, 2018.
Y. Bengio, "“Learning deep architectures for AI”, Found. Trends®", Mach. Learn., vol. 2, no. 1, pp. 1-127, 2009.
A. Kaur, S. Jain, and S. Goel, "SP-J48: a novel optimization and machine-learning-based approach for solving complex problems: special application in software engineering for detecting code smells", Neural Comput. Appl., vol. 32, pp. 7009-7027, 2020.
A. Kaur, S. Jain, and S. Goel, "Sandpiper optimization algorithm: a novel approach for solving real-life engineering problems", Appl. Intell., vol. 50, no. 2, pp. 582-619, 2020.
F. Palomba, G. Bavota, M. Di Penta, R. Oliveto, and A. De Lucia, "Do they really smell bad? a study on developers’ perception of bad code smells", IEEE International Conference on Software Maintenance and Evolution, 2014pp. 101-110
D. Taibi, A. Janes, and V. Lenarduzzi, "How developers perceive smells in source code: A replicated study", Inf. Softw. Technol., vol. 92, pp. 223-235, 2017.
G. Dhiman, and V. Kumar, "Spotted Hyena Optimizer: A novel bio-inspired based Metaheuristic technique for engineering applications", Adv. Eng. Softw., vol. 114, pp. 48-70, 2017.
P. Singh, and G. Dhiman, "A Hybrid Fuzzy Time Series Forecasting Model based on Granular Computing and Bio-inspired Optimization Approaches", J. Comput. Sci., vol. 27, pp. 370-385, 2018.
G. Dhiman, and V. Kumar, "Multi-objective Spotted Hyena Optimizer: A Multi-objective Optimization Algorithm for Engineering Problems", Knowl. Base. Syst., vol. 150, pp. 175-197, 2018.
P. Singh, and G. Dhiman, "Uncertainty representation using fuzzy-entropy approach: special application in remotely sensed high-resolution satellite images (RSHRSIs)", Appl. Soft Comput., vol. 72, pp. 121-139, 2018.
G. Dhiman, and V. Kumar, "Emperor penguin optimizer: a bio-inspired algorithm for engineering problems", Knowl. Base. Syst., vol. 159, pp. 20-50, 2018.
P. Singh, K. Rabadiya, and G. Dhiman, "A four-way decision making system for the Indian summer monsoon rainfall", Mod. Phys. Lett. B, vol. 32, no. 25, 2018.
G. Dhiman, and V. Kumar, "Astrophysics inspired multi-objective approach for automatic clustering and feature selection in real-life environment", Mod. Phys. Lett. B, vol. 32, no. 31, 2018.
A. Kaur, S. Kaur, and G. Dhiman, "A quantum method for dynamic nonlinear programming technique using Schrödinger equation and monte carlo approach", Mod. Phys. Lett. B, vol. 32, no. 30, 2018.
G. Dhiman, S. Guo, and S. Kaur, "ED-SHO: A framework for solving nonlinear economic load power dispatch problem using spotted hyena optimizer", Mod. Phys. Lett. A, vol. 33, no. 40, 2018.
G. Dhiman, and V. Kumar, "Seagull optimization algorithm: Theory and its applications for large-scale industrial engineering problems", Knowl. Base. Syst., vol. 165, pp. 169-196, 2019.
G. Dhiman, and A. Kaur, "STOA: A bio-inspired based optimization algorithm for industrial engineering problems", Eng. Appl. Artif. Intell., vol. 82, pp. 148-174, 2019.
G. Dhiman, and V. Kumar, "KnRVEA: A hybrid evolutionary algorithm based on knee points and reference vector adaptation strategies for many-objective optimization", Appl. Intell., vol. 49, no. 7, pp. 2434-2460, 2019.
G. Dhiman, P. Singh, H. Kaur, and R. Maini, "DHIMAN: a novel algorithm for economic dispatch problem based on optimization MetHod usIng Monte Carlo Simulation and Astrophysics CoNcepts", Mod. Phys. Lett. A, vol. 34, no. 4, 2019.
G. Dhiman, "MOSHEPO: A hybrid multi-objective approach to solve economic load dispatch and micro grid problems", Appl. Intell., vol. 50, pp. 119-137, 2019.
P. Singh, G. Dhiman, S. Guo, R. Maini, H. Kaur, A. Kaur, H. Kaur, J. Singh, and N. Singh, "A hybrid fuzzy quantum time series and linear programming model: special application on TAIEX index dataset", Mod. Phys. Lett. A, vol. 34, no. 25, 2019.
G. Dhiman, "ESA: A Hybrid Bio-inspired Metaheuristic Optimization Approach for Engineering Problems", Eng. Comput., vol. 37, pp. 323-353, 2019.
M. Dehghani, Z. Montazeri, O.P. Malik, G. Dhiman, and V. Kumar, "BOSA: binary orientation search algorithm", Int. J. Innovative Technol. Explor. Eng., vol. 9, pp. 5306-5310, 2019.
M. Garg, and G. Dhiman, "Deep convolution neural network approach for defect inspection of textured surfaces", J. Institute Electron. Comput., vol. 2, pp. 28-38, 2020.
S. Kaur, L. Awasthi, A. Sangal, and G. Dhiman, "Tunicate swarm algorithm: a new bio-inspired based Metaheuristic paradigm for global optimization", Eng. Appl. Artif. Intell., 2020.
G. Dhiman, M. Soni, H.M. Pandey, A. Slowik, and H. Kaur, "A novel hybrid evolutionary algorithm based on hypervolume indicator and reference vector adaptation strategies for many-objective optimization", Eng. Comput., 2020.
M. Dehghani, Z. Montazeri, O. Malik, K. Al-Haddad, J.M. Guerrero, and G. Dhiman, "A new methodology called dice game optimizer for capacitor placement in distribution systems"In: Electrical Engineering and Electromechanics, vol. 1. 2020, pp. 61-64.
G. Dhiman, M. Garg, A. Nagar, V. Kumar, and M. Dehghani, "A Novel Algorithm for Global Optimization: Rat Swarm Optimizer", J. Ambient Intell. Humaniz. Comput., 2020.
M. Garg, and G. Dhiman, "A novel content based image retrieval approach for classification using GLCM features and texture fused LBP variants", Neural Comput. Appl., 2020.
G. Dhiman, and A. Kaur, "HKn-RVEA: a novel many-objective evolutionary algorithm for car side impact bar crashworthiness problem", Int. J. Veh. Des., 2020.
G. Dhiman, and M. Garg, "MoSSE: A novel hybrid multi-objective meta-heuristic algorithm for engineering design problemsS", Soft Comput., 2020.
P. Singh, and G. Dhiman, "A fuzzy-LP approach in time series forecasting", In: International Conference on Pattern Recognition and Machine Intelligence, 2017pp. 243-253
G. Dhiman, and A. Kaur, "Spotted Hyena Optimizer for Solving Engineering Design Problems", In: 2017 International Conference on machine learning and data science (MLDS), IEEE, 2017, pp. 114-119.
S. Verma, S. Kaur, G. Dhiman, and A. Kaur, "Design of a Novel energy efficient routing framework for wireless nanosensor networks", In: 2018 First International Conference on Secure Cyber Computing and Communication (ICSCCC), 2018pp. 532-536
G. Dhiman, and A. Kaur, A Hybrid Algorithm based on Particle Swarm and Spotted Hyena Optimizer for Global Optimization.In: Soft Computing for Problem Solving., Springer, 2019, pp. 599-615.
F. Huang, X. Zhang, Z. Li, and Z. Zhao, "Bi-directional spatial-semantic attention networks for image-text matching", IEEE Trans. Image Process., vol. 28, no. 4, pp. 2008-2020, 2018.
[] [PMID: 30452372]
F. Huang, X. Zhang, Z. Li, Z. Zhao, and Y. He, "From content to links: Social image embedding with deep multimodal model", Knowl. Base. Syst., vol. 160, pp. 251-264, 2018.
F. Huang, X. Zhang, J. Xu, Z. Zhao, and Z. Li, "Multimodal learning of social image representation by exploiting social relations", IEEE Trans. Cybern., 2019.
[] [PMID: 30843858]
F. Huang, X. Zhang, and Z. Li, "Learning joint multimodal representation with adversarial attention networks", Proceedings of the 26th ACM international conference on Multimedia, 2018pp. 1874-1882

Rights & Permissions Print Export Cite as
© 2022 Bentham Science Publishers | Privacy Policy