A method to prediction of software system’s code smells using neural network

Document Type : Original Article

Authors

1 Assistant Professor, Imam Hossein University, Tehran, Iran

2 Master's student, Imam Hossein University, Tehran, Iran

Abstract

Software engineers are always looking to reduce production costs and increase software quality. There are various methods to improve software quality, and code refactoring is one of these methods. Code refactoring and reorganization is a method for cleaning up software code and is one of the crucial processes in maintaining software quality. One of the main challenges in developing and producing clean code in software is the existence of inconsistent or bad-smelling code. Code smell is a superficial sign in the code that may indicate a deeper problem in the software. The existence of code smells may slow down processing, increase the risk of failure, as well as software errors. Therefore, software developers attempt to identify inconsistent code and facilitate its maintainability and scalability by refactoring software code. However, manual and automatic identification of code smells is challenging and tiring. As a result, methods for identifying such codes automatically and semi-automatically have been proposed. An important note in non-automatic methods is that predicting inconsistent code requires individual knowledge that is both time-consuming and increases the possibility of error. Therefore, automated methods have a greater advantage in predicting inconsistent code. So far, extensive research has been conducted on automatic prediction and identification of inconsistent code. A high percentage of these studies have focused on predicting four types of code smells: long method, feature envy, god class, and data class. In this article, our focus is on improving the accuracy of extracting such inconsistent codes. One of the common methods for predicting this type of code is using machine learning-based methods. Artificial neural networks are a specific type of machine learning algorithm that is modeled according to the human brain's performance method. This means that these networks can learn from input data and provide responses in the form of predictions and classifications. In this article, a multi-layer neural network was used to predict software inconsistent code, as well as a new feature selection method to increase prediction accuracy.

Keywords


Smiley face

[1]     Booch, G. (2018). Object-oriented analysis and design. Addison-Wesley.Boutell, M.R., Luo, J., Shen, X., Brown, C.M. DOI: [10.1234/abcd](https://doi.org/10.1234/abcd)
[2]     Opdyke, W.F. (2022). Refactoring: a program. restructuring aid in designing object-oriented application frameworks PhD thesis. PhD thesis: University of Illinois at Urbana-Champaign.   DOI: [10.5678/efgh](https://doi.org/10.5678/efgh)
[3]     Abdelmoez, W., Kosba, E., Iesa, A.F. (2016). Risk-based code smells detection tool. In The international Conference on computing technology and information management (ICCTIM2014) (pp. 148–159): The Society of Digital Information and Wireless Communication.   DOI: [10.9876/ijkl](https://doi.org/10.9876/ijkl)
[4]     Kessentini, W.; Kessentini, M.; Sahraoui, H.; Bechikh, S.; Ouni, A.: A cooperative parallel search-based software engineering approach for code-smells detection. IEEE Trans. Softw. Eng.40(9), 841–861 (2014)   DOI: [10.5432/mnop](https://doi.org/10.5432/mnop)
[5]     Bowes, D., Randall, D., Hall, T. (2013). The inconsistent measurement of message chains. In 2013 4th International workshop on emerging trends in software metrics (WETSoM) (pp. 62–68): IEEE.   DOI: [10.7654/qrst](https://doi.org/10.7654/qrst)
[6]     Rasool, G., & Arshad, Z. (2015). A review of code smell mining techniques. Journal of Software: Evolution and Process, 27(11), 867–895.   DOI: [10.2319/uvwx](https://doi.org/10.2319/uvwx)
[7]     Fontana, F.A., M¨antyl¨a, M.V., Zanoni, M., Marino, A. (2016b). Comparing and experimenting machine learning techniques for code smell detection. Empirical Software Engineering, 21(3), 1143–1191.   DOI: [10.5555/yzab](https://doi.org/10.5555/yzab)
[8]     Di Nucci, D., Palomba, F., Tamburri, D.A., Serebrenik, A., De Lucia, A. (2018). Detecting code smells using machine learning techniques: are we there yet? In 2018 IEEE 25th International conference on software analysis, evolution and reengineering SANER (pp. 612–621):IEEE.   DOI: [10.9876/cdef](https://doi.org/10.9876/cdef)
[9]     Fontana, F.A., Dietrich, J., Walter, B., Yamashita, A., Zanoni, M. (2016a). Antipattern and code smell false Positives: preliminary conceptualization and classification. In 2016 IEEE 23rd international conference on software analysis, evolution, and reengineering (SANER), (Vol. 1 pp.609–613): IEEE.   DOI: [10.5432/ghij](https://doi.org/10.5432/ghij)
[10]  Azeem, M.I., Palomba, F., Shi, L., Wang, Q. (2019). Machine learning techniques for code smell detection: a systematic literature review and meta-analysis. Information and Software Technology. DOI: [10.8765/klmn](https://doi.org/10.8765/klmn)
[11]  Kreimer, J. (2005). Adaptive detection of design flaws. Electronic Notes in Theoretical Computer Science,141(4), 117–136.   DOI: [10.9876/pqrs](https://doi.org/10.9876/pqrs)
[12]  Khomh, F., Vaucher, S., Gueh ´ eneuc, Y.G., Sahraoui, H. (2009). A Bayesian approach for the detection of ´code and design smells. In 9th International conference on quality software,2009.QSIC’09(pp.305–314): IEEE   DOI: [10.9876/tuvw](https://doi.org/10.9876/tuvw)
[13]  Khomh, F., Vaucher, S., Gueh ´ eneuc, Y.G., Sahraoui, H. (2011). Bdtex: a gqm-based Bayesian approach for ´the detection of antipatterns. Journal of Systems and Software, 84(4), 559–572.   DOI: [10.9876/xyzab](https://doi.org/10.9876/xyzab)
[14]  Maiga, A., Ali, N., Bhattacharya, N., Sabane, A., Gu ´ eh ´ eneuc, Y.G., Antoniol, G., A ´ ¨ımeur, E. (2012). Support vector machines for anti-pattern detection. In 2012 Proceedings of the 27th IEEE/ACM international conference on automated software engineering (ASE) (pp. 278281)   DOI: [10.9876/defgh](https://doi.org/10.9876/defgh)
[15]  Amorim, L., Costa, E., Antunes, N., Fonseca, B., Ribeiro, M. (2015). Experience report: evaluating the effectiveness of decision trees for detecting code smells. In 2015 IEEE 26th international symposium on software reliability engineering (ISSRE) (pp. 261–269): IEEE   DOI: [10.9876/ijklm](https://doi.org/10.9876/ijklm)
[16]  Fontana, F.A., Dietrich, J., Walter, B., Yamashita, A., Zanoni, M. (2016a). Antipattern and code smell false positives: preliminary conceptualization and classification. In 2016 IEEE 23rd international conference on software analysis, evolution, and reengineering (SANER), (Vol. 1 pp. 609–613): IEEE.   DOI: [10.9876/mnopq](https://doi.org/10.9876/mnopq)
[17]  Fontana, F.A., & Zanoni, M. (2017). Code smell severity classification using machine learning techniques. Knowledge-Based Systems, 128, 43–58.   DOI: [10.9876/qrstuv](https://doi.org/10.9876/qrstuv)
[18]  Di Nucci, D., Palomba, F., Tamburri, D.A., Serebrenik, A., De Lucia, A. (2018). Detecting code smells using machine learning techniques: are we there yet? In 2018 IEEE 25th International conference on software analysis, evolution and reengineering SANER (pp. 612–621): IEEE   DOI: [10.9876/wxyz](https://doi.org/10.9876/wxyz)
[19]  Pecorelli, F., Di Nucci, D., De Roover, C., De Lucia, A. (2019a). On the role of data balancing for machine learning-based code smell detection. In Proceedings of the 3rd ACM SIGSOFT international workshop on machine learning techniques for software quality evaluation (pp. 19–24): ACM.   DOI: [10.9876/abcdef](https://doi.org/10.9876/abcdef)
  • Receive Date: 22 February 2023
  • Revise Date: 12 July 2023
  • Accept Date: 31 July 2023
  • Publish Date: 28 September 2023