Toward accurate detection on change barriers

In software development, it is easy to introduce code smells owing to the complexity of projects and the negligence of programmers. Code smells reduce code comprehensibility and maintainability, making programs error-prone. Hence, code smell detection is extremely important. Recently, machine learning-based technologies turn to be the mainstream detection approaches, which show promising performance. However, existing machine learning methods have two limitations: (1) most studies only focus on common smells, and (2) the proposed metrics are not effective when being used for uncommon code smell detection, e.g., change barrier based code smells. To overcome these limitations, this paper investigates the detection of uncommon change barrier based code smells. We study three typical code smells, i.e., Divergent Change, Shotgun Surgery, and Parallel Inheritance, which all belong to change barriers. We analyze the characteristics of change barriers and extract domain-specific metrics to train a Logistic Regression model for detection. The experimental results show that our method achieves 81.8%–100% precision and recall, outperforming existing algorithms by 10%–30%. In addition, we analyze the correlation and importance of the utilized metrics. We find our domain-specific metrics are important for the detection of change barriers. The results would help practitioners better design detection tools for such code smells.

[1]  Alexander Chatzigeorgiou,et al.  JDeodorant: Identification and Removal of Feature Envy Bad Smells , 2007, ICSM.

[2]  Andrea De Lucia,et al.  Detecting code smells using machine learning techniques: Are we there yet? , 2018, 2018 IEEE 25th International Conference on Software Analysis, Evolution and Reengineering (SANER).

[3]  Charles P. Staelin Parameter selection for support vector machines , 2002 .

[4]  G.C. Murphy,et al.  Identifying, Assigning, and Quantifying Crosscutting Concerns , 2007, First International Workshop on Assessment of Contemporary Modularization Techniques (ACoM '07).

[5]  Harichandran Khanna Nehemiah,et al.  Hybrid particle swarm optimisation with mutation for code smell detection , 2018, Int. J. Bio Inspired Comput..

[6]  Bora Caglayan,et al.  Software Analytics in Practice: A Defect Prediction Model Using Code Smells , 2016, IDEAS.

[7]  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.

[8]  Houari A. Sahraoui,et al.  Design Defects Detection and Correction by Example , 2011, 2011 IEEE 19th International Conference on Program Comprehension.

[9]  Hardeep Singh,et al.  DynaMetrics: a runtime metric-based analysis tool for object-oriented software systems , 2008, SOEN.

[10]  Marouane Kessentini,et al.  Competitive Coevolutionary Code-Smells Detection , 2013, SSBSE.

[11]  Cláudio Sant'Anna,et al.  On the Effectiveness of Concern Metrics to Detect Code Smells: An Empirical Study , 2014, CAiSE.

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

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

[14]  Fabio Palomba,et al.  Textual Analysis for Code Smell Detection , 2015, 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering.

[15]  Jia Xu,et al.  Extreme learning machines: new trends and applications , 2014, Science China Information Sciences.

[16]  Marouane Kessentini,et al.  Search-Based Web Service Antipatterns Detection , 2017, IEEE Transactions on Services Computing.

[17]  Foutse Khomh,et al.  BDTEX: A GQM-based Bayesian approach for the detection of antipatterns , 2011, J. Syst. Softw..

[18]  อนิรุธ สืบสิงห์,et al.  Data Mining Practical Machine Learning Tools and Techniques , 2014 .

[19]  Francesca Arcelli Fontana,et al.  Automatic Metric Thresholds Derivation for Code Smell Detection , 2015, 2015 IEEE/ACM 6th International Workshop on Emerging Trends in Software Metrics.

[20]  Chris F. Kemerer,et al.  A Metrics Suite for Object Oriented Design , 2015, IEEE Trans. Software Eng..

[21]  Sushma Jain,et al.  A Support Vector Machine Based Approach for Code Smell Detection , 2017, 2017 International Conference on Machine Learning and Data Science (MLDS).

[22]  Yann-Gaël Guéhéneuc,et al.  DECOR: A Method for the Specification and Detection of Code and Design Smells , 2010, IEEE Transactions on Software Engineering.

[23]  Ian H. Witten,et al.  Data mining: practical machine learning tools and techniques, 3rd Edition , 1999 .

[24]  Cristina Marinescu,et al.  iPlasma: An Integrated Platform for Quality Assessment of Object-Oriented Design , 2005, ICSM.

[25]  Foutse Khomh,et al.  IDS: An Immune-Inspired Approach for the Detection of Software Design Smells , 2010, 2010 Seventh International Conference on the Quality of Information and Communications Technology.

[26]  Jochen Kreimer,et al.  Adaptive Detection of Design Flaws , 2005, LDTA@ETAPS.

[27]  Satwinder Singh,et al.  Predicting Software Defects through SVM: An Empirical Approach , 2018, ArXiv.

[28]  Nakarin Maneerat,et al.  Bad-smell prediction from software design model using machine learning techniques , 2011, 2011 Eighth International Joint Conference on Computer Science and Software Engineering (JCSSE).

[29]  Foutse Khomh,et al.  Tracking Design Smells: Lessons from a Study of God Classes , 2009, 2009 16th Working Conference on Reverse Engineering.

[30]  Foutse Khomh,et al.  A Bayesian Approach for the Detection of Code and Design Smells , 2009, 2009 Ninth International Conference on Quality Software.

[31]  Zhi-Hua Zhou,et al.  Abductive learning: towards bridging machine learning and logical reasoning , 2019, Science China Information Sciences.

[32]  Baldoino Fonseca dos Santos Neto,et al.  Experience report: Evaluating the effectiveness of decision trees for detecting code smells , 2015, 2015 IEEE 26th International Symposium on Software Reliability Engineering (ISSRE).