Three Heads Are Better Than One: Suggesting Move Method Refactoring Opportunities with Inter-class Code Entity Dependency Enhanced Hybrid Hypergraph Neural Network

Methods implemented in incorrect classes will cause excessive reliance on other classes than their own, known as a typical code smell symptom: feature envy, which makes it difficult to maintain increased coupling between classes. Addressing this issue, several Move Method refactoring tools have been...

Full description

Saved in:
Bibliographic Details
Published inIEEE/ACM International Conference on Automated Software Engineering : [proceedings] pp. 745 - 757
Main Authors Cui, Di, Wang, Jiaqi, Wang, Qiangqiang, Ji, Peng, Qiao, Minglang, Zhao, Yutong, Hu, Jingzhao, Wang, Luqiao, Li, Qingshan
Format Conference Proceeding
LanguageEnglish
Published ACM 27.10.2024
Subjects
Online AccessGet full text
ISSN2643-1572
DOI10.1145/3691620.3695068

Cover

Loading…
Abstract Methods implemented in incorrect classes will cause excessive reliance on other classes than their own, known as a typical code smell symptom: feature envy, which makes it difficult to maintain increased coupling between classes. Addressing this issue, several Move Method refactoring tools have been proposed, employing a two-phase process: identifying misplaced methods to move and appropriate classes to receive, and implementing the mechanics of refactoring. These tools traditionally use hard-coded metrics to measure correlations between movable methods and target classes and apply heuristic thresholds or trained classifiers to unearth refactoring opportunities. Yet, these approaches predominantly illuminate pairwise correlations between methods and classes while overlooking the complex and complicated dependencies binding multiple code entities within these methods/classes that are prevalent in real- world cases. This narrow focus can lead to refactoring suggestions that may diverge from developers' actual needs. To bridge this gap, our paper leverages the concept of inter-class code entity dependency hypergraph to model complicated dependency relationships involving multiple code entities within various methods/classes and proposes a hypergraph learning-based approach to suggest Move Method refactoring opportunities named HMove. We first construct inter-class code entity dependency hypergraphs from training samples and assign attributes to entities with a pre-trained code model. All the attributed hypergraphs are fed into a hybrid hypergraph neural network for training. Utilizing this trained neural network alongside a large language model, we construct a refactoring suggestion system. We trained HMove on a large-scale dataset and evaluated it on two real-world datasets. The results show that demonstrates an increase of 27.8% in precision, 2.5% in recall, and 18.5% in f1-measure compared to 9 state-of-the-art refactoring tools, which is more useful for 68% of participants. The results also unveil practical suggestions and new insights that benefit existing feature envy-related refactoring techniques.CCS CONCEPTS* Software and its engineering 4 Software Maintenance.
AbstractList Methods implemented in incorrect classes will cause excessive reliance on other classes than their own, known as a typical code smell symptom: feature envy, which makes it difficult to maintain increased coupling between classes. Addressing this issue, several Move Method refactoring tools have been proposed, employing a two-phase process: identifying misplaced methods to move and appropriate classes to receive, and implementing the mechanics of refactoring. These tools traditionally use hard-coded metrics to measure correlations between movable methods and target classes and apply heuristic thresholds or trained classifiers to unearth refactoring opportunities. Yet, these approaches predominantly illuminate pairwise correlations between methods and classes while overlooking the complex and complicated dependencies binding multiple code entities within these methods/classes that are prevalent in real- world cases. This narrow focus can lead to refactoring suggestions that may diverge from developers' actual needs. To bridge this gap, our paper leverages the concept of inter-class code entity dependency hypergraph to model complicated dependency relationships involving multiple code entities within various methods/classes and proposes a hypergraph learning-based approach to suggest Move Method refactoring opportunities named HMove. We first construct inter-class code entity dependency hypergraphs from training samples and assign attributes to entities with a pre-trained code model. All the attributed hypergraphs are fed into a hybrid hypergraph neural network for training. Utilizing this trained neural network alongside a large language model, we construct a refactoring suggestion system. We trained HMove on a large-scale dataset and evaluated it on two real-world datasets. The results show that demonstrates an increase of 27.8% in precision, 2.5% in recall, and 18.5% in f1-measure compared to 9 state-of-the-art refactoring tools, which is more useful for 68% of participants. The results also unveil practical suggestions and new insights that benefit existing feature envy-related refactoring techniques.CCS CONCEPTS* Software and its engineering 4 Software Maintenance.
Author Qiao, Minglang
Ji, Peng
Cui, Di
Wang, Qiangqiang
Wang, Luqiao
Wang, Jiaqi
Hu, Jingzhao
Zhao, Yutong
Li, Qingshan
Author_xml – sequence: 1
  givenname: Di
  surname: Cui
  fullname: Cui, Di
  email: cuidi@xidian.edu.cn
  organization: Xidian University,Xi'an,China
– sequence: 2
  givenname: Jiaqi
  surname: Wang
  fullname: Wang, Jiaqi
  email: jiaqi@stu.xidian.edu.cn
  organization: Xidian University,Xi'an,China
– sequence: 3
  givenname: Qiangqiang
  surname: Wang
  fullname: Wang, Qiangqiang
  email: wangqiangqiang@stu.xidian.edu.cn
  organization: Xidian University,Xi'an,China
– sequence: 4
  givenname: Peng
  surname: Ji
  fullname: Ji, Peng
  email: jipeng@stu.xidian.edu.cn
  organization: Xidian University,Xi'an,China
– sequence: 5
  givenname: Minglang
  surname: Qiao
  fullname: Qiao, Minglang
  email: qiaoml@stu.xidian.edu.cn
  organization: Xidian University,Xi'an,China
– sequence: 6
  givenname: Yutong
  surname: Zhao
  fullname: Zhao, Yutong
  email: yutongzhao@ucmo.edu
  organization: University of Central Missouri,Warrensburg,USA
– sequence: 7
  givenname: Jingzhao
  surname: Hu
  fullname: Hu, Jingzhao
  email: hujingzhao@xidian.edu.cn
  organization: Xidian University,Xi'an,China
– sequence: 8
  givenname: Luqiao
  surname: Wang
  fullname: Wang, Luqiao
  email: wangluqiao@stu.xidian.edu.cn
  organization: Xidian University,Xi'an,China
– sequence: 9
  givenname: Qingshan
  surname: Li
  fullname: Li, Qingshan
  email: qshli@mail.xidian.edu.cn
  organization: Xidian University,Xi'an,China
BookMark eNotj0FPwjAcxavRRETOXjz0CwzbtWs7b4goJCCJ4pl03X-sEbulLZJ9Hr-oI3r6vbzD7-VdowvXOEDolpIxpTy7ZyKnIiXjnhkR6gyNcpkrToikKVfyHA1SwVlCM5leoVEItiB9zASlYoB-NrUHwHPQZcATD_gRYgSPN7V2eO3gAb8fdjsI0bodXjXfgFcQ66bEb1BpExt_6tdt2_h4cDZaCPhoY40XrrckZq9DwNOmBDxz0cYOP0ELrgRnur7pNwyUeN4V3p7Qgt953db4FQ5e73vEY-M_b9BlpfcBRv8coo_n2WY6T5brl8V0skx0_zMmuqgkUTQXBQFGIDNKlxWRnKeFUJypklQpKFNRkmeC6argkKeyqHJqDCuAsSG6-_NaANi23n5p320pkYIrxtkv-Ptv8A
CODEN IEEPAD
ContentType Conference Proceeding
DBID 6IE
6IL
CBEJK
RIE
RIL
DOI 10.1145/3691620.3695068
DatabaseName IEEE Electronic Library (IEL) Conference Proceedings
IEEE Proceedings Order Plan All Online (POP All Online) 1998-present by volume
IEEE Xplore All Conference Proceedings
IEEE Electronic Library (IEL)
IEEE Proceedings Order Plans (POP All) 1998-Present
DatabaseTitleList
Database_xml – sequence: 1
  dbid: RIE
  name: IEEE Electronic Library (IEL)
  url: https://proxy.k.utb.cz/login?url=https://ieeexplore.ieee.org/
  sourceTypes: Publisher
DeliveryMethod fulltext_linktorsrc
Discipline Computer Science
EISBN 9798400712487
EISSN 2643-1572
EndPage 757
ExternalDocumentID 10764834
Genre orig-research
GrantInformation_xml – fundername: Xidian University
  funderid: 10.13039/501100005320
– fundername: National Natural Science Foundation of China
  funderid: 10.13039/501100001809
– fundername: Natural Science Foundation of Jiangsu Province
  funderid: 10.13039/501100004608
GroupedDBID 6IE
6IF
6IH
6IK
6IL
6IM
6IN
6J9
AAJGR
AAWTH
ABLEC
ACREN
ADYOE
ADZIZ
AFYQB
ALMA_UNASSIGNED_HOLDINGS
AMTXH
BEFXN
BFFAM
BGNUA
BKEBE
BPEOZ
CBEJK
CHZPO
IEGSK
IPLJI
M43
OCL
RIE
RIL
ID FETCH-LOGICAL-a248t-abf708196b0e30e5c8adf07442b68438d0f2e8cf109563afb4e927bf91cc3be33
IEDL.DBID RIE
IngestDate Wed Jan 15 06:20:43 EST 2025
IsPeerReviewed false
IsScholarly true
Language English
LinkModel DirectLink
MergedId FETCHMERGED-LOGICAL-a248t-abf708196b0e30e5c8adf07442b68438d0f2e8cf109563afb4e927bf91cc3be33
PageCount 13
ParticipantIDs ieee_primary_10764834
PublicationCentury 2000
PublicationDate 2024-Oct.-27
PublicationDateYYYYMMDD 2024-10-27
PublicationDate_xml – month: 10
  year: 2024
  text: 2024-Oct.-27
  day: 27
PublicationDecade 2020
PublicationTitle IEEE/ACM International Conference on Automated Software Engineering : [proceedings]
PublicationTitleAbbrev ASE
PublicationYear 2024
Publisher ACM
Publisher_xml – name: ACM
SSID ssib057256116
ssj0051577
Score 2.2863855
Snippet Methods implemented in incorrect classes will cause excessive reliance on other classes than their own, known as a typical code smell symptom: feature envy,...
SourceID ieee
SourceType Publisher
StartPage 745
SubjectTerms Codes
Correlation
Couplings
Hypergraph Neural Network
Large language models
Measurement
Move Method Refactoring
Neural networks
Pairwise error probability
Software engineering
Software maintenance
Training
Title Three Heads Are Better Than One: Suggesting Move Method Refactoring Opportunities with Inter-class Code Entity Dependency Enhanced Hybrid Hypergraph Neural Network
URI https://ieeexplore.ieee.org/document/10764834
hasFullText 1
inHoldings 1
isFullTextHit
isPrint
link http://utb.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwjV1Na9wwEBVNTj0laTe0SVrm0Ks3tvXp3tJtwlJIUtoN5BYsedRAgnfZrAubv9M_2hnZ25ZCICcZgYyQRp7n0bw3QnyoGuuUiy4j9NtkKuYxcxrzTDfkYK30DJo52-LCTK_Ul2t9PZDVExcGEVPyGY75Md3lN_PQcaiMTrg1HPzaEltkZz1Za2M82pLzLhjr9J9h8tPWDlo-hdLH0hAQKukf1VQ6Z2HVf4qpJF9ytiMuNrPoU0juxt3Kj8PjfwKNz57mrhj9pe3B1z8OaU-8wPaV2NnUbYDhGL8Wv2a0gQhT2t4HOFkifEqcHpjd1i1ctvgRvnc_-N6J3gLn858I56nONHzDvjwP918uGLl3bVJkBQ7nQoouZoHxOEzmDcIpc4DX8HkotBvW1HObUg5gumaqGDULXCbRbGCZkPqempSXPhJXZ6ezyTQbijVkdancKqt9tAwvjM9R5qiDq5tI-ESV3jglXZPHEl2IBSsfyjp6hVVpfayKEKRHKffFdjtv8Y2ASjtTGxUKryIN1y43vmhQmTrkXlr7Vox40W8WvR7HzWa9D57oPxQvS4Ii7HFKeyS2V8sO3xGUWPn3yYR-A3V-yd8
linkProvider IEEE
linkToHtml http://utb.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwjV1Li9RAEG50PehpfYz4tg5eMybpZ7zpukvUnVnRWdjbkO5Uu6BkhnEijH_HP2pVJ6MiCJ4SGhKafuT7Ul3fV0I8q1rrlIsuI_bbZirmMXMa80y3BLBWeibNnG0xN_W5enuhL0axetLCIGJKPsMp36az_HYVeg6V0Q63hoNfV8U1An6lB7nWfvloS_BdMNsZPsSE1NaObj6F0s-lISpU0l-qqXTO1qp_lFNJaHJyKOb7fgxJJJ-n_dZPw_e_LBr_u6M3xeS3cA_e_4KkW-IKdrfF4b5yA4wb-Y74saApRKhpgr_Cyw3Cq6TqgcVl08FZhy_gY_-JT57oLTBbfUOYpUrT8AGHAj3cfrZm7t53yZMVOKALKb6YBWbkcLRqEY5ZBbyD12Op3bCjlsuUdAD1jsVidFnjJtlmAxuFNF_okjLTJ-L85HhxVGdjuYasKZXbZo2PlgmG8TnKHHVwTRuJoajSG6eka_NYoguxYO9D2USvsCqtj1URgvQo5V1x0K06vCeg0s40RoXCq0iPa5cbX7SoTBNyL629LyY86Mv14Mix3I_3g3-0PxXX68XsdHn6Zv7uobhREjFh_CntI3Gw3fT4mIjF1j9Jy-knLQXNLA
openUrl ctx_ver=Z39.88-2004&ctx_enc=info%3Aofi%2Fenc%3AUTF-8&rfr_id=info%3Asid%2Fsummon.serialssolutions.com&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=proceeding&rft.title=IEEE%2FACM+International+Conference+on+Automated+Software+Engineering+%3A+%5Bproceedings%5D&rft.atitle=Three+Heads+Are+Better+Than+One%3A+Suggesting+Move+Method+Refactoring+Opportunities+with+Inter-class+Code+Entity+Dependency+Enhanced+Hybrid+Hypergraph+Neural+Network&rft.au=Cui%2C+Di&rft.au=Wang%2C+Jiaqi&rft.au=Wang%2C+Qiangqiang&rft.au=Ji%2C+Peng&rft.date=2024-10-27&rft.pub=ACM&rft.eissn=2643-1572&rft.spage=745&rft.epage=757&rft_id=info:doi/10.1145%2F3691620.3695068&rft.externalDocID=10764834