Improving the Identification of Code Smells by Combining Structural and Semantic Information

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.

[1]  Zhi Jin,et al.  Building Program Vector Representations for Deep Learning , 2014, KSEM.

[2]  Nadia Bouassida,et al.  Towards a Taxonomy of Bad Smells Detection Approaches , 2018 .

[3]  Foutse Khomh,et al.  Do Code Smells Impact the Effort of Different Maintenance Programming Activities? , 2016, 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER).

[4]  Beijun Shen,et al.  Code Bad Smell Detection through Evolutionary Data Mining , 2015, 2015 ACM/IEEE International Symposium on Empirical Software Engineering and Measurement (ESEM).

[5]  Andrea De Lucia,et al.  A textual-based technique for Smell Detection , 2016, 2016 IEEE 24th International Conference on Program Comprehension (ICPC).

[6]  Diomidis Spinellis,et al.  A survey on software smells , 2018, J. Syst. Softw..

[7]  Gabriele Bavota,et al.  When and Why Your Code Starts to Smell Bad (and Whether the Smells Go Away) , 2015, IEEE Transactions on Software Engineering.

[8]  Max Welling,et al.  Auto-Encoding Variational Bayes , 2013, ICLR.

[9]  Gabriele Bavota,et al.  On the diffuseness and the impact on maintainability of code smells: a large scale empirical investigation , 2018, Empirical Software Engineering.

[10]  Hui Liu,et al.  Deep Learning Based Feature Envy Detection , 2018, 2018 33rd IEEE/ACM International Conference on Automated Software Engineering (ASE).

[11]  Fabio Palomba Alternative Sources of Information for Code Smell Detection: Postcards from Far Away , 2016, 2016 IEEE International Conference on Software Maintenance and Evolution (ICSME).

[12]  Nadia Bouassida,et al.  A Hybrid Approach To Detect Code Smells using Deep Learning , 2018, ENASE.

[13]  Gabriele Bavota,et al.  Mining Version Histories for Detecting Code Smells , 2015, IEEE Transactions on Software Engineering.

[14]  Song Wang,et al.  Automatically Learning Semantic Features for Defect Prediction , 2016, 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE).

[15]  Martin Fowler,et al.  Refactoring - Improving the Design of Existing Code , 1999, Addison Wesley object technology series.

[16]  Gabriele Bavota,et al.  Landfill: An Open Dataset of Code Smells with Public Evaluation , 2015, 2015 IEEE/ACM 12th Working Conference on Mining Software Repositories.

[17]  Mika Mäntylä,et al.  Comparing and experimenting machine learning techniques for code smell detection , 2015, Empirical Software Engineering.

[18]  Nadia Bouassida,et al.  Deep Representation Learning for Code Smells Detection using Variational Auto-Encoder , 2019, 2019 International Joint Conference on Neural Networks (IJCNN).

[19]  Alexander Chatzigeorgiou,et al.  Identification of Move Method Refactoring Opportunities , 2009, IEEE Transactions on Software Engineering.

[20]  Andrea De Lucia,et al.  [Journal First] The Scent of a Smell: An Extensive Comparison Between Textual and Structural Smells , 2018, 2018 IEEE/ACM 40th International Conference on Software Engineering (ICSE).

[21]  Chong-Ho Choi,et al.  Input feature selection for classification problems , 2002, IEEE Trans. Neural Networks.