Correlation Feature Mining Model Based on Dual Attention for Feature Envy Detection

Shuxin Zhao, Chongyang Shi, Shaojun Ren, Hufsa Mohsin · Proceedings/Proceedings of the ... International Conference on Software Engineering and Knowledge Engineering · 2022

Feature Envy is a code smell due to the abnormal calling relationships between methods and classes, which adversely affects software scalability and maintainability.Existing methods mainly use various technologies to model abnormal relationships to detect feature envy.However, these methods only rely on local features such as entity names, which is not robust enough.Moreover, the mining depth of correlation features between entities involved in feature envy is limited.In this paper, we propose a correlation feature mining model based on dual attention to detect feature envy.Firstly, we propose a multi-view-based entity representation strategy, which enhanced the robustness of the model while improving the suitability of the correlation feature and model.Secondly, we add attention mechanism to the channel dimension and spatial dimension of CNN to control the flow of information and capture the correlation features between entities more accurately.Finally, the evaluation results on projects both with and without feature envy injected show that our proposed approach outperforms the state-of-the-art methods.

Read the paper · More papers on PaperTik