Type-Directed Program Synthesis for RESTful APIs

Type-Directed Program Synthesis for RESTful APIs
复制标题

RESTful API 的类型导向程序综合

DOI:
10.1145/3519939.3523450
复制
发表时间:
2022
期刊:
Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation
影响因子:
--
通讯作者:
Polikarpova, Nadia
Polikarpova, Nadia
中科院分区:
--
文献类型:
--
作者:
Guo, Zheng;Cao, David;Tjong, Davin;Yang, Jean;Schlesinger, Cole;Polikarpova, Nadia

文献摘要

相似文献

随着软件即服务和微服务架构的兴起,RESTful api现在在移动和web应用程序中无处不在。服务可以有数十或数百个API方法,这使得程序员很难找到正确的方法组合来解决他们的任务。我们介绍了APIphany,这是一个基于组件的合成器,用于编写对RESTful api的调用。APIphany背后的主要创新是使用精确的语义类型,既可以指定用户意图,也可以指导搜索。APIphany提供了三种新的机制来克服基于组件的合成适应REST领域的挑战:(1)一种类型推断算法,用于用语义类型增强REST规范;(2)用于“整理”半结构化数据的有效合成技术,这在使用RESTful api时通常是必需的;(3)一种新的模拟执行形式,以避免在合成过程中执行api调用。我们在三个真实世界的api和从GitHub存储库和StackOverflow中提取的32个任务上评估APIphany。在我们的实验中,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.