A refactoring must preserve the program's functionality. However, not all refactorings are correct. Preservation of the functionality must be checked. Since programs are rarely formally specified, we use the original program as functional specification and check whether the original and refactored program are functionally equivalent. More concretely, our PEQcheck technique follows a common approach and reduces equivalence checking to program verification. To increase efficiency, PEQcheck generates several verification tasks, namely one per refactored code segment and not one per function as typically done by prior work. Additionally, PEQcheck takes the context of the segments into account. For example, only modified, live variables need to be equivalent and read-only variables can be shared between original and refactored code segments. We proved soundness of our PEQcheck technique and implemented it in a prototype tool. Our evaluation shows that the localized checking of PEQcheck can indeed be beneficial.
翻译:重设必须保存程序功能。 但是, 并非所有重设都正确 。 保存功能必须检查 。 由于程序很少正式指定, 我们使用原始程序作为功能规格, 并检查原始和重设程序是否等同功能 。 更具体地说, 我们的 PEQ check 技术遵循共同的方法, 并减少对等性检查来进行程序验证 。 为了提高效率, PEQ check 生成了多个核查任务, 即每个重设代码部分一个, 而不是以往工作通常完成的每个功能一个 。 此外, PEQ check 将部分的上下文考虑在内 。 例如, 仅修改过的、 活变量需要等同和只读的变量才能在原始和重设代码部分之间共享 。 我们证明了我们的 PEQ check 技术的正确性, 并在原型工具中应用了它。 我们的评估显示, 对 PEQ check 进行局部检查确实是有益的 。