Abstract
In software engineering, a code smell is an indication of a deeper problem in the source code, hindering the maintainability and evolvability of the system. In the literature, there is a significant emphasis on the detection of code smells because of its importance as a maintenance task. Most of previous studies focus in their analyses on one source of information, i.e. structural, historical or semantic information. However, some instances of bad smells could be identified by a type of information but missed by another one. In this paper, we propose an improved detection approach that combines structural and semantic information in order to fully exploit their complementarity in the identification of code smells. Both information are extracted separately using conventional and deep learning methods. For the evaluation, we have selected five open source projects which are JHotDraw, Apache Karaf, Freemind, Apache Nutch and JEdit. In order to optimize our performance results, we have set up four different experiments and compare between them. The obtained accuracy results confirm the effectiveness of combining structural and semantic information in improving the detection of code smells.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
References
Fontana, A.F., Mäntylä, M.V., Zanoni, M., Marino, A.: Comparing and experimenting machine learning techniques for code smell detection. Empir. Softw. Eng. 21, 1143–1191 (2016)
Fowler, M., Beck, K., Brant, J., Opdyke, W., Roberts, D.: Refactoring: Improving the Design of Existing Code. Pearson Education India (1999)
Fu, S., Shen, B.: Code bad smell detection through evolutionary data mining. In: Symposium on Empirical Engineering and Measurement, pp. 1–9 (2015)
Hadj-Kacem, M., Bouassida, N.: A hybrid approach to detect code smells using deep learning. In: International Conference on Evaluation of Novel Approaches to Software Engineering, pp. 137–146 (2018)
Hadj-Kacem, M., Bouassida, N.: Towards a taxonomy of bad smells detection approaches. In: International Conference on Software Technologies, pp. 164–175. SciTePress (2018)
Hadj-Kacem, M., Bouassida, N.: Deep representation learning for code smells detection using variational auto-encoder. In: International Joint Conference on Neural Networks. IEEE (2019)
Kingma, D.P., Welling, M.: Auto-encoding variational bayes. arXiv (2013)
Kwak, N., Choi, C.-H.: Input feature selection for classification problems. IEEE Trans. Neural Netw. 13, 143–159 (2002)
Liu, H., Xu, Z., Zou, Y.: Deep learning based feature envy detection. In: International Conference on Automated Software Engineering, pp. 385–396. ACM (2018)
Palomba, F., Bavota, G., Penta, M.D., Oliveto, R., Poshyvanyk, D., Lucia, A.D.: Mining version histories for detecting code smells. IEEE Trans. Softw. Eng. 41, 462–489 (2015)
Palomba, F., Panichella, A., Lucia, A.D., Oliveto, R., Zaidman, A.: A textual-based technique for smell detection. In: International Conference on Program Comprehension, pp. 1–10. IEEE (2016)
Palomba, F.: Alternative sources of information for code smell detection: postcards from far away. In: International Conference on Software Maintenance and Evolution, pp. 636–640 (2016)
Palomba, F., Bavota, G., et al.: On the diffuseness and the impact on maintainability of code smells: a large scale empirical investigation. Empir. Softw. Eng. 23, 1188–1221 (2018)
Palomba, F., Nucci, D.D., et al.: Landfill: an open dataset of code smells with public evaluation. In: Working Conference on Mining Software Repositories, pp. 482–485. IEEE (2015)
Palomba, F., Panichella, A., et al.: The scent of a smell: an extensive comparison between textual and structural smells. IEEE Trans. Softw. Eng. 44, 977–1000 (2018)
Peng, H., Mou, L., Li, G., Liu, Y., Zhang, L., Jin, Z.: Building program vector representations for deep learning. In: Zhang, S., Wirsing, M., Zhang, Z. (eds.) KSEM 2015. LNCS (LNAI), vol. 9403, pp. 547–553. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-25159-2_49
Sauer, F., Boissier, G.: Eclipse metrics plugin 1.3.8. http://metrics2.sourceforge.net/
Sharma, T., Spinellis, D.: A survey on software smells. J. Syst. Softw. 138, 158–173 (2018)
Soh, Z., et al.: Do code smells impact the effort of different maintenance programming activities? In: International Conference on Software Analysis, Evolution, and Reengineering, pp. 393–402 (2016)
Tsantalis, N., Chatzigeorgiou, A.: Identification of move method refactoring opportunities. IEEE Trans. Softw. Eng. 35, 347–367 (2009)
Tufano, M., Palomba, F., et al.: When and why your code starts to smell bad. In: International Conference on Software Engineering, pp. 403–414. IEEE (2015)
Wang, S., Liu, T., Tan, L.: Automatically learning semantic features for defect prediction. In: International Conference on Software Engineering, pp. 297–308 (2016)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2019 Springer Nature Switzerland AG
About this paper
Cite this paper
Hadj-Kacem, M., Bouassida, N. (2019). Improving the Identification of Code Smells by Combining Structural and Semantic Information. In: Gedeon, T., Wong, K., Lee, M. (eds) Neural Information Processing. ICONIP 2019. Communications in Computer and Information Science, vol 1142. Springer, Cham. https://doi.org/10.1007/978-3-030-36808-1_32
Download citation
DOI: https://doi.org/10.1007/978-3-030-36808-1_32
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-36807-4
Online ISBN: 978-3-030-36808-1
eBook Packages: Computer ScienceComputer Science (R0)