arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2408.06568cs.SE
收藏

MORCoRA: 多目标重构推荐考虑审查可用性

MORCoRA: Multi-Objective Refactoring Recommendation Considering Review Availability

School of Computing, Tokyo Institute of Technology(东京工业大学理工学院)

Lei Chen, Shinpei Hayashi

AI总结:

MORCoRA通过多目标搜索推荐高代码质量和高审查可用性的重构序列及合适审查者。

摘要:

背景:基于搜索的重构涉及搜索一系列重构以实现特定目标。虽然典型的目标是提高代码质量,但需要不同的视角;搜索出的序列必须在应用前经过审查,如果审查失败或因没有合适的审查者而被推迟,则可能无法应用。目标:因此,确保搜索出的重构序列能够被满足两个条件的审查者及时审查至关重要:1)具有足够的专业知识;2)没有繁重的工作量。这两个条件被视为重构序列的审查可用性。方法:我们提出MORCoRA,一种多目标的基于搜索的技术,可以搜索出能够提高代码质量、保持语义并具有高审查可用性的重构序列及其相应的合适审查者。结果:我们在六个开源仓库上评估了MORCoRA。定量分析表明,MORCoRA能够有效推荐符合要求的重构序列。定性分析显示,MORCoRA推荐的重构可以提高代码质量并有效解决代码异味。此外,这些重构推荐的审查者具有高水平的专业知识且有时间进行审查。结论:我们建议重构推荐者在推荐重构时应考虑对质量改进的影响以及所需的开发者资源。

英文摘要:

Background: Search-based refactoring involves searching for a sequence of refactorings to achieve specific objectives. Although a typical objective is improving code quality, a different perspective is also required; the searched sequence must undergo review before being applied and may not be applied if the review fails or is postponed due to no proper reviewers. Aim: Therefore, it is essential to ensure that the searched sequence of refactorings can be reviewed promptly by reviewers who meet two criteria: 1) having enough expertise and 2) being free of heavy workload. The two criteria are regarded as the review availability of the refactoring sequence. Method: We propose MORCoRA, a multi-objective search-based technique that can search for code quality improvable, semantic preserved, and high review availability possessed refactoring sequences and corresponding proper reviewers. Results: We evaluate MORCoRA on six open-source repositories. The quantitative analysis reveals that MORCoRA can effectively recommend refactoring sequences that fit the requirements. The qualitative analysis demonstrates that the refactorings recommended by MORCoRA can enhance code quality and effectively address code smells. Furthermore, the recommended reviewers for those refactorings possess high expertise and are available to review. Conclusions: We recommend that refactoring recommenders consider both the impact on quality improvement and the developer resources required for review when recommending refactorings.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑