论文标题
用于恢复API的类型定向程序合成
Type-Directed Program Synthesis for RESTful APIs
论文作者
论文摘要
随着软件即服务和微服务体系结构的兴起,现在在移动和Web应用程序中无处不在。服务可以具有数十个或数百种API方法,这使程序员找到正确解决其任务的方法的挑战。 我们提出了Apiphany,这是一种基于组件的合成器,用于构成对Restful API的呼叫的程序。 Apiphany背后的主要创新是使用精确的语义类型来指定用户意图并指导搜索。 Apiphany为克服基于组件的合成对剩余领域的挑战提供了三种新型机制:(1)一种类型的推理算法,用于增强使用语义类型的静止状况; (2)一种用于“争吵”半结构化数据的有效合成技术,这通常是使用Restful API的; (3)一种新的模拟执行形式,以避免在合成过程中执行API调用。我们在三个现实世界中的API和32个任务上评估了从GitHub存储库和Stackoverflow提取的32个任务。在我们的实验中,Apiphany找到了29项任务的正确解决方案,其中23个据报道了十大综合结果。
With the rise of software-as-a-service and microservice architectures, RESTful APIs are now ubiquitous in mobile and web applications. A service can have tens or hundreds of API methods, making it a challenge for programmers to find the right combination of methods to solve their task. We present APIphany, a component-based synthesizer for programs that compose calls to RESTful APIs. The main innovation behind APIphany is the use of precise semantic types, both to specify user intent and to direct the search. APIphany contributes three novel mechanisms to overcome challenges in adapting component-based synthesis to the REST domain: (1) a type inference algorithm for augmenting REST specifications with semantic types; (2) an efficient synthesis technique for "wrangling" semi-structured data, which is commonly required in working with RESTful APIs; and (3) a new form of simulated execution to avoid executing APIs calls during synthesis. We evaluate APIphany on three real-world APIs and 32 tasks extracted from GitHub repositories and StackOverflow. In our experiments, APIphany found correct solutions to 29 tasks, with 23 of them reported among top ten synthesis results.