Local and global feature based explainable feature envy detection

Xin Yin, Chongyang Shi*, Shuxin Zhao

*Corresponding author for this work

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

10 Citations (Scopus)

Abstract

Code smell detection can help developers identify position of code smell in projects and enhance the quality of software system. Usually codes with similar semantic relationships have greater code dependencies, and most code smell detection methods ignore dependencies relationships within the source code. Thus, their detection results may be heavily influenced by inadequate code feature, which can lead to some code smell not being detected. In addition, existing methods cannot explain the correlation between detection results and code information. However, an explainable result can help developers make better judgments on code smell reconstruction. Accordingly, in this paper, we propose a local and global feature based explainable approach to detecting feature envy, one of the most common code smells. For the model to make the most of code information, we design different representation models for global code and local code respectively to extract different feature envy features, and automatically combine these features that are beneficial in terms of detection accuracy. We further design a code semantic dependency (CSD) to make the detection result easy to explain. The evaluation results of seven manual building code smell projects and three real projects show that the proposed approach improves on the state-of-the-art in detecting feature envy and boosting the explainability of results.

Original languageEnglish
Title of host publicationProceedings - 2021 IEEE 45th Annual Computers, Software, and Applications Conference, COMPSAC 2021
EditorsW. K. Chan, Bill Claycomb, Hiroki Takakura, Ji-Jiang Yang, Yuuichi Teranishi, Dave Towey, Sergio Segura, Hossain Shahriar, Sorel Reisman, Sheikh Iqbal Ahamed
PublisherInstitute of Electrical and Electronics Engineers Inc.
Pages942-951
Number of pages10
ISBN (Electronic)9781665424639
DOIs
Publication statusPublished - Jul 2021
Event45th IEEE Annual Computers, Software, and Applications Conference, COMPSAC 2021 - Virtual, Online, Spain
Duration: 12 Jul 202116 Jul 2021

Publication series

NameProceedings - 2021 IEEE 45th Annual Computers, Software, and Applications Conference, COMPSAC 2021

Conference

Conference45th IEEE Annual Computers, Software, and Applications Conference, COMPSAC 2021
Country/TerritorySpain
CityVirtual, Online
Period12/07/2116/07/21

Keywords

  • Deep learning
  • Feature envy
  • Software refactoring

Fingerprint

Dive into the research topics of 'Local and global feature based explainable feature envy detection'. Together they form a unique fingerprint.

Cite this