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

Kayak:Java流的安全语义重构

Kayak: Safe Semantic Refactoring to Java Streams

Cristina David, Pascal Kesseli, Daniel Kroening

摘要:

重构是对现有软件的结构化更改,使其外部可观察的行为保持不变。其目的是提高可读性、性能或其他非行为属性。最先进的自动重构工具是语法驱动的,因此过于保守。在本文中,我们将探讨语义驱动的重构,这使得更复杂的重构模式。作为这个更广泛的想法的一个例子,我们提出了Kayak,一个自动重构工具,它将Java与外部迭代集合转换为使用Streams的代码,Streams是Java 8引入的一个新抽象。我们的重构过程执行语义推理和搜索的空间中可能的重构使用自动程序合成。我们的实验结果支持的猜想,语义驱动的重构更精确,能够重写更复杂的代码场景相比,语法驱动的重构。

英文摘要:

Refactorings are structured changes to existing software that leave its externally observable behaviour unchanged. Their intent is to improve readability, performance or other non-behavioural properties. State-of-the-art automatic refactoring tools are syntax-driven and, therefore, overly conservative. In this paper we explore semantics-driven refactoring, which enables much more sophisticated refactoring schemata. As an exemplar of this broader idea, we present Kayak, an automatic refactoring tool that transforms Java with external iteration over collections into code that uses Streams, a new abstraction introduced by Java 8. Our refactoring procedure performs semantic reasoning and search in the space of possible refactorings using automated program synthesis. Our experimental results support the conjecture that semantics-driven refactorings are more precise and are able to rewrite more complex code scenarios when compared to syntax-driven refactorings.

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

↑