Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/3238147.3238166acmconferencesArticle/Chapter ViewAbstractPublication PagesaseConference Proceedingsconference-collections
research-article

Deep learning based feature envy detection

Published: 03 September 2018 Publication History

Abstract

Software refactoring is widely employed to improve software quality. A key step in software refactoring is to identify which part of the software should be refactored. To facilitate the identification, a number of approaches have been proposed to identify certain structures in the code (called code smells) that suggest the possibility of refactoring. Most of such approaches rely on manually designed heuristics to map manually selected source code metrics to predictions. However, it is challenging to manually select the best features, especially textual features. It is also difficult to manually construct the optimal heuristics. To this end, in this paper we propose a deep learning based novel approach to detecting feature envy, one of the most common code smells. The key insight is that deep neural networks and advanced deep learning techniques could automatically select features (especially textual features) of source code for feature envy detection, and could automatically build the complex mapping between such features and predictions. We also propose an automatic approach to generating labeled training data for the neural network based classifier, which does not require any human intervention. Evaluation results on open-source applications suggest that the proposed approach significantly improves the state-of-the-art in both detecting feature envy smells and recommending destinations for identified smelly methods.

References

[1]
2018. Areca. http://www.areca-backup.org/. 2018. Freeplane. https://www.freeplane.org/. 2018. jEdit. http://www.jedit.org/. 2018. JExcelAPI. http://jexcelapi.sourceforge.net/. 2018. JSmooth. http://jsmooth.sourceforge.net/. 2018. JUnit. https://junit.org/. 2018. Neuroph. http://neuroph.sourceforge.net/. 2018. PMD. https://pmd.github.io/. 2018. XDM. http://xdman.sourceforge.net/.
[2]
Lucas Amorim, Evandro Costa, Nuno Antunes, Baldoino Fonseca, and Márcio Ribeiro. 2015. Experience report: Evaluating the effectiveness of decision trees for detecting code smells. In Software Reliability Engineering (ISSRE), 2015 IEEE 26th International Symposium on. IEEE, 261–269.
[3]
Francesca Arcelli Fontana, Mika V. Mäntylä, Marco Zanoni, and Alessandro Marino. 2016. Comparing and experimenting machine learning techniques for code smell detection. Empirical Software Engineering 21, 3 (01 Jun 2016), 1143– 1191.
[4]
V. Arnaoudova, L. M. Eshkevari, M. D. Penta, R. Oliveto, G. Antoniol, and Y. G. GuÃľhÃľneuc. 2014. REPENT: Analyzing the Nature of Identifier Renamings. IEEE Transactions on Software Engineering 40, 5 (May 2014), 502–532.
[5]
G. Bavota, R. Oliveto, M. Gethers, D. Poshyvanyk, and A. De Lucia. 2014. Methodbook: Recommending Move Method Refactorings via Relational Topic Models. Software Engineering, IEEE Transactions on 40, 7 (July 2014), 671–694.
[6]
D. Bobkov, S. Chen, R. Jian, M. Z. Iqbal, and E. Steinbach. 2018. Noise-Resistant Deep Learning for Object Classification in Three-Dimensional Point Clouds Using a Point Pair Descriptor. IEEE Robotics and Automation Letters 3, 2 (April 2018), 865–872.
[7]
Jehad Al Dallal. 2014. Identifying Refactoring Opportunities in Object-Oriented Code: A Systematic Literature Review. Information and Software Technology 0 (2014), –.
[8]
Francesca Arcelli Fontana, Mika V Mäntylä, Marco Zanoni, and Alessandro Marino. 2016. Comparing and experimenting machine learning techniques for code smell detection. Empirical Software Engineering 21, 3 (2016), 1143–1191.
[9]
Francesca Arcelli Fontana and Marco Zanoni. 2017. Code smell severity classification using machine learning techniques. Knowledge-Based Systems 128 (2017), 43–58.
[10]
Francesca Arcelli Fontana, Marco Zanoni, Alessandro Marino, and Mika V Mantyla. 2013. Code smell detection: Towards a machine learning-based approach. In Software Maintenance (ICSM), 2013 29th IEEE International Conference on. IEEE, 396–399.
[11]
Martin Fowler, Kent Beck, John Brant, William Opdyke, and Don Roberts. 1999. Refactoring: Improving the Design of Existing Code. Addison Wesley Professional.
[12]
William G. Griswold and David Notkin. 1993. Automated assistance for program restructuring. ACM Transactions on Software Engineering and Methodology (TOSEM) 2, 3 (July 1993), 228–269.
[13]
Xiaodong Gu, Hongyu Zhang, Dongmei Zhang, and Sunghun Kim. 2016. Deep API Learning. In Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering (FSE 2016). ACM, New York, NY, USA, 631–642.
[14]
K. Hwang and W. Sung. 2016. Character-level incremental speech recognition with recurrent neural networks. In 2016 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP). 5335–5339.
[15]
ICASSP.2016.7472696
[16]
Keras. 2018. Flatten Layer. Retrieved July 21, 2018 from https://github.com/ keras-team/keras/blob/master/keras/layers/core.py#L467
[17]
Keras. 2018. Keras: The Python Deep Learning Library. https://github.com/ keras-team/keras/blob/master/keras/models.py
[18]
Keras. 2018. Merge Layer. Retrieved July 21, 2018 from https://github.com/ keras-team/keras/blob/master/keras/layers/merge.py
[19]
Foutse Khomh, Stéphane Vaucher, Yann-Gaël Guéhéneuc, and Houari Sahraoui. 2009. A bayesian approach for the detection of code and design smells. In Quality Software, 2009. QSIC’09. 9th International Conference on. IEEE, 305–314.
[20]
Foutse Khomh, Stephane Vaucher, Yann-Gaël Guéhéneuc, and Houari Sahraoui. 2011. BDTEX: A GQM-based Bayesian approach for the detection of antipatterns. Journal of Systems and Software 84, 4 (2011), 559–572.
[21]
Jochen Kreimer. 2005. Adaptive detection of design flaws. Electronic Notes in Theoretical Computer Science 141, 4 (2005), 117–136.
[22]
Hui Liu, Xue Guo, and Weizhong Shao. 2013. Monitor-Based Instant Software Refactoring. IEEE Transactions on Software Engineering 39, 8 (2013), 1112–1126.
[23]
H. Liu, Q. Liu, Z. Niu, and Y. Liu. 2016. Dynamic and Automatic Feedback-Based Threshold Adaptation for Code Smell Detection. IEEE Transactions on Software Engineering 42, 6 (June 2016), 544–558.
[24]
H. Liu, Y. Wu, W. Liu, Q. Liu, and C. Li. 2016. Domino Effect: Move More Methods Once a Method is Moved. In 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER), Vol. 1. 1–12.
[25]
Hui Liu, Zhifeng Xu, and Yanzhen Zou. 2018. Replace CNN with Dense Layers. Retrieved July 21, 2018 from https://github.com/liuhuigmail/FeatureEnvy/tree/ master/Algorithm/DenseVScnn
[26]
Abdou Maiga, Nasir Ali, Neelesh Bhattacharya, Aminata Sabane, Yann-Gael Gueheneuc, and Esma Aimeur. 2012. SMURF: A SVM-based incremental antipattern detection approach. In Reverse engineering (WCRE), 2012 19th working conference on. IEEE, 466–475.
[27]
Abdou Maiga, Nasir Ali, Neelesh Bhattacharya, Aminata Sabané, Yann-Gaël Guéhéneuc, Giuliano Antoniol, and Esma Aïmeur. 2012. Support vector machines for anti-pattern detection. In Proceedings of the 27th IEEE/ACM International Conference on Automated Software Engineering. ACM, 278–281.
[28]
Mika V. Mäntylä and Casper Lassenius. 2006. Subjective evaluation of software evolvability using code smells: An empirical study. Empirical Software Engineering 11, 3 (01 Sep 2006), 395–431.
[29]
Tom Mens, Niels Van Eetvelde, and Serge Demeyer. 2005. Formalizing Refactorings with Graph Transformations. Journal of Software Maintenance and Evolution: Research and Practice 17, 4 (2005), 247–276.
[30]
Tom Mens and Tom Tourwé. 2004. A Survey of Software Refactoring. IEEE Transactions on Software Engineering 30, 2 (2004), 126–139.
[31]
Tomas Mikolov, Kai Chen, Greg Corrado, and Jeffrey Dean. 2013. Efficient Estimation of Word Representations in Vector Space. CoRR abs/1301.3781 (2013).
[32]
arXiv: 1301.3781 http://arxiv.org/abs/1301.3781
[33]
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S Corrado, and Jeff Dean. 2013. Distributed Representations of Words and Phrases and their Compositionality. In Advances in Neural Information Processing Systems 26, C. J. C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K. Q. Weinberger (Eds.). Curran Associates, Inc., 3111–3119.
[34]
D. Di Nucci, F. Palomba, D. A. Tamburri, A. Serebrenik, and A. De Lucia. 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). 612–621.
[35]
D. Di Nucci, F. Palomba, D. A. Tamburri, A. Serebrenik, and A. De Lucia. 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). 612–621.
[36]
William F. Opdyke. 1992. Refactoring Object-Oriented Frameworks. Ph.D. Dissertation. University of Illinois at Urbana-Champaign.
[37]
William F. Opdyke. 1992. Refactoring Object-oriented Frameworks. Ph.D. Dissertation. Champaign, IL, USA. UMI Order No. GAX93-05645.
[38]
H. Palangi, L. Deng, Y. Shen, J. Gao, X. He, J. Chen, X. Song, and R. Ward. 2016. Deep Sentence Embedding Using Long Short-Term Memory Networks: Analysis and Application to Information Retrieval. IEEE/ACM Transactions on Audio, Speech, and Language Processing 24, 4 (April 2016), 694–707. 1109/TASLP.2016.2520371
[39]
F. Palomba, G. Bavota, M. Di Penta, R. Oliveto, D. Poshyvanyk, and A. De Lucia. 2015. Mining Version Histories for Detecting Code Smells. Software Engineering, IEEE Transactions on 41, 5 (May 2015), 462–489. 2014.2372760
[40]
Fabio Palomba, Gabriele Bavota, Massimiliano Di Penta, Fausto Fasano, Rocco Oliveto, and Andrea De Lucia. 2017. On the diffuseness and the impact on maintainability of code smells: a large scale empirical investigation. Empirical Software Engineering (07 Aug 2017).
[41]
F. Palomba, A. Panichella, A. De Lucia, R. Oliveto, and A. Zaidman. 2016. A textualbased technique for Smell Detection. In 2016 IEEE 24th International Conference on Program Comprehension (ICPC). 1–10.
[42]
F. Palomba, A. Panichella, A. De Lucia, R. Oliveto, and A. Zaidman. 2016. A textualbased technique for Smell Detection. In 2016 IEEE 24th International Conference on Program Comprehension (ICPC). 1–10.
[43]
Y. Pan, T. Mei, T. Yao, H. Li, and Y. Rui. 2016. Jointly Modeling Embedding and Translation to Bridge Video and Language. In 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). 4594–4602.
[44]
[45]
S. Ren, K. He, R. Girshick, and J. Sun. 2017. Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks. IEEE Transactions on Pattern Analysis and Machine Intelligence 39, 6 (June 2017), 1137–1149.
[46]
10.1109/TPAMI.2016.2577031
[47]
V. Sales, R. Terra, L.F. Miranda, and M.T. Valente. 2013. Recommending Move Method refactorings using dependency sets. In Reverse Engineering (WCRE), 2013 20th Working Conference on. 232–241.
[48]
[49]
Olaf Seng, Johannes Stammel, and David Burkhart. 2006. Search-based determination of refactorings for improving the class structure of object-oriented systems. In In Proceedings of the 8th annual conference on genetic and evolutionary computation. 1909–1916.
[50]
Tushar Sharma and Diomidis Spinellis. 2018. A survey on software smells. Journal of Systems and Software 138 (2018), 158 – 173. ASE ’18, September 3–7, 2018, Montpellier, France Hui Liu, Zhifeng Xu, and Yanzhen Zou
[51]
F. Simon, F.Steinbrucker, and C.Lewerentz. 2001. Metrics Based Refactoring. In Proceedings of Europen Conference on Software Maintenance and Reengineering. 30–38.
[52]
Ricardo Terra, Marco Tulio Valente, Sergio Miranda, and Vitor Sales. 2018. JMove: A novel heuristic and tool to detect move method refactoring opportunities. Journal of Systems and Software 138 (2018), 19 – 36. 2017.11.073
[53]
Frank Tip, Adam Kiezun, and Dirk Baeumer. 2003. Refactoring for Generalization Using Type Constraints. In Proceedings of the Eighteenth Annual Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA’03). Anaheim, CA, 13–26.
[54]
Nikolaos Tsantalis and Alexander Chatzigeorgiou. 2009. Identification of Move Method Refactoring Opportunities. IEEE Transactions on Software Engineering 35, 3 (2009), 347–367.
[55]
Stephane Vaucher, Foutse Khomh, Naouel Moha, and Yann-Gaël Guéhéneuc. 2009. Tracking design smells: Lessons from a study of god classes. In Reverse Engineering, 2009. WCRE’09. 16th Working Conference on. IEEE, 145–154.
[56]
Weka. {n. d.}. http://www.cs.waikato.ac.nz/ml/weka/.
[57]
D. Wu, N. Sharma, and M. Blumenstein. 2017. Recent advances in video-based human action recognition using deep learning: A review. In 2017 International Joint Conference on Neural Networks (IJCNN). 2865–2872.
[58]
IJCNN.2017.7966210
[59]
Zhifeng Xu. 2018. Source Code. Retrieved July 21, 2018 from https://github.com/ liuhuigmail/FeatureEnvy/blob/master/Algorithm/train-CNN.py
[60]
K. Zhang, W. Zuo, Y. Chen, D. Meng, and L. Zhang. 2017. Beyond a Gaussian Denoiser: Residual Learning of Deep CNN for Image Denoising. IEEE Transactions on Image Processing 26, 7 (July 2017), 3142–3155.
[61]
2017.2662206

Cited By

View all
  • (2025)Ensemble methods with feature selection and data balancing for improved code smells classification performanceEngineering Applications of Artificial Intelligence10.1016/j.engappai.2024.109527139:PAOnline publication date: 1-Jan-2025
  • (2025)Efficient feature envy detection and refactoring based on graph neural networkAutomated Software Engineering10.1007/s10515-024-00476-332:1Online publication date: 1-Jun-2025
  • (2025)Code Smell Detection Using Deep Learning Models to Enhance the Software QualityComputing, Communication and Learning10.1007/978-3-031-79041-6_3(31-43)Online publication date: 1-Feb-2025
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ASE '18: Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering
September 2018
955 pages
ISBN:9781450359375
DOI:10.1145/3238147
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 03 September 2018

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Code Smells
  2. Deep Learning
  3. Feature Envy
  4. Software Refactoring

Qualifiers

  • Research-article

Funding Sources

  • National Natural Science Foundation of China
  • National Key Research and Development Program of China

Conference

ASE '18
Sponsor:

Acceptance Rates

Overall Acceptance Rate 82 of 337 submissions, 24%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)62
  • Downloads (Last 6 weeks)4
Reflects downloads up to 16 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2025)Ensemble methods with feature selection and data balancing for improved code smells classification performanceEngineering Applications of Artificial Intelligence10.1016/j.engappai.2024.109527139:PAOnline publication date: 1-Jan-2025
  • (2025)Efficient feature envy detection and refactoring based on graph neural networkAutomated Software Engineering10.1007/s10515-024-00476-332:1Online publication date: 1-Jun-2025
  • (2025)Code Smell Detection Using Deep Learning Models to Enhance the Software QualityComputing, Communication and Learning10.1007/978-3-031-79041-6_3(31-43)Online publication date: 1-Feb-2025
  • (2024)Practitioners' Expectations on Code Smell Detection2024 IEEE 48th Annual Computers, Software, and Applications Conference (COMPSAC)10.1109/COMPSAC61105.2024.00175(1324-1333)Online publication date: 2-Jul-2024
  • (2024)An Evaluation of Multi-Label Classification Approaches for Method-Level Code Smells DetectionIEEE Access10.1109/ACCESS.2024.338785612(53664-53676)Online publication date: 2024
  • (2024)Improving and comparing performance of machine learning classifiers optimized by swarm intelligent algorithms for code smell detectionScience of Computer Programming10.1016/j.scico.2024.103140(103140)Online publication date: May-2024
  • (2024)Actionable code smell identification with fusion learning of metrics and semanticsScience of Computer Programming10.1016/j.scico.2024.103110236:COnline publication date: 1-Sep-2024
  • (2024)Code smell detection based on supervised learning models: A surveyNeurocomputing10.1016/j.neucom.2023.127014565(127014)Online publication date: Jan-2024
  • (2024)On the effectiveness of developer features in code smell prioritization: A replication studyJournal of Systems and Software10.1016/j.jss.2024.111968210(111968)Online publication date: Apr-2024
  • (2024)Feature envy detection based on cross-graph local semantics matchingInformation and Software Technology10.1016/j.infsof.2024.107515174:COnline publication date: 1-Oct-2024
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media