一句话:提出借助自动合成的类间状态等价谓词,将候选类 R 合成为与原类 O 功能等价的替换类的技术。
论文提出一种自动合成替换类(replacement class)的技术。给定原始类 O 与候选替换类 R,该技术先合成 O 与 R 状态之间的类间等价谓词,再借助该谓词逐一合成替换方法,使得每个方法都保持对应对象的状态等价。由此可在方法级独立合成的同时,保证任意长调用序列后原对象与替换对象仍处于等价状态。作者将该技术实现为工具 Mask,并在开源 Java 类上进行评估,结果验证了其在合成替换类方面的有效性。
We present a new technique for automatically synthesizing replacement classes. The technique starts with an original class O and a potential replacement class R, then uses R to synthesize a new class that implements the same interface and provides the same functionality as O. Critically, our technique works with a synthe- sized inter-class equivalence predicate between the states of O and R. It uses this predicate to ensure that original and synthesized methods leave corresponding O and R objects in equivalent states. The predicate therefore enables the technique to synthesize individual replacement methods in isolation while still obtain- ing a replacement class that leaves the original and replacement objects in equivalent states after arbitrarily long method invocation sequences. We have implemented the technique as part of a tool, named Mask, and evaluated it using open-source Java classes. The results highlight the effectiveness of Mask in synthesizing replacement classes.