RESTful API的类型导向程序合成
Type-Directed Program Synthesis for RESTful APIs
摘要:
随着软件即服务和微服务架构的兴起,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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。