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

诊断重构风险

Diagnosing Refactoring Dangers

Wouter Brinksma, William Wernsen, Evert Verduin, Herman Hilberink, Patrick de Beer, Lex Bijlsma, Harrie Passier

AI总结:

本文提出了一种检测重构风险的概念模型及Eclipse插件ReFD,通过微步骤划分和判定机制识别实际风险并减少误报,为开发者提供可操作的重构风险解决方案。

摘要:

本报告研究了软件重构与行为保持之间的关系。现有的行为保持分析通常缺乏对重构拒绝的全面见解,且未提供可操作的解决方案。为解决这些问题,我们开发了一个概念模型来检测重构风险,并基于该模型创建了一个名为ReFD的Eclipse插件。每个重构都可以划分为微步骤,每个微步骤都带有潜在风险。ReFD评估给定的代码上下文,以识别这些潜在风险是否存在,使其成为实际风险,并采用判定机制来减少误报。为了便于风险检测,定义了几个称为检测器和子检测器的组件,这些组件可被多个重构复用。该工具通过实现多个重构的检测进行了验证,产生了关于所检测风险的预期信息。这些信息引导开发者积极思考重构在实际代码库中可能引起的问题的解决方案。

英文摘要:

This report investigates the relationship between software refactoring and behavior preservation. Existing behavior preservation analyses often lack comprehensive insights into refactoring rejections and do not provide actionable solutions. To address these issues, we developed a conceptual model to detect refactoring dangers, and created an Eclipse plugin based upon this model, called ReFD. Every refactoring can be partitioned in microsteps, each of which carries potential risks. ReFD evaluates a given code context to identify if these potential risks are present, making them actual risks, and employs a verdict mechanism to reduce false positives. To facilitate the risk detection, several components called detectors and subdetectors are defined, which can be reused for multiple refactorings. The tool was validated by implementing the detection for multiple refactorings, which produce the expected information about the risks detected. This information leads a developer to actively think about solutions to the problems a refactoring might cause within an actual codebase.

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

↑