arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2101.09042cs.LOcs.PL
收藏

PEQcheck:本地化和上下文感知的功能等效性检查(技术报告)

PEQcheck: Localized and Context-aware Checking of Functional Equivalence (Technical Report)

Marie-Christine Jakobs

摘要:

重构不得改变程序的功能。然而,并不是所有的重构都满足这个要求。因此,必须明确检查重构不会改变功能。由于很少有一个正式的规格说明程序的行为,我们利用原来的程序作为功能规范。然后,我们检查原始程序和重构后的程序在功能上是否等价。为此,我们采用一个共同的想法,减少等价性检查程序验证。为了提高效率,我们的等价性检查PEQcheck构造一个验证任务,每个重构的代码段,而不是一个功能,通常由以前的工作。此外,PEQcheck考虑代码段的上下文。例如,只有被修改的和活的变量才需要是等效的,只读变量可以在原始代码段和重构的代码段之间共享。此外,我们的评估证明,本地化和上下文感知检查执行的\peqcheck确实可以是有益的。

英文摘要:

Refactorings must not alter the program's functionality. However, not all refactorings fulfill this requirement. Hence, one must explicitly check that a refactoring does not alter the functionality. Since one rarely has a formal specification of the program's behavior, we utilize the original program as functional specification. Then, we check whether the original and refactored program are functionally equivalent. To this end, we apply a common idea and reduce equivalence checking to program verification. To increase efficiency, our equivalence checker PEQcheck constructs one verification task per refactored code segment instead of one per function as typically done by prior work. In addition, PEQcheck considers the context of the code segments. For instance, only variables that are modified and live are required to be equivalent and read-only variables may be shared between original and refactored code segments. We show that PEQcheck is sound.Moreover, our evaluation testifies that the localized and context-aware checking performed by \peqcheck can indeed be beneficial.

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

↑