When designing a new API for a large project, developers need to make smart design choices so that their code base can grow sustainably. To ensure that new API components are well designed, developers can learn from existing API components. However, the lack of standardized method for comparing API designs makes this learning process time-consuming and difficult. To address this gap we developed the API-Spector, to the best of our knowledge one of the first API-to-API specification recommendation engines. API-Spector retrieves relevant specification components written in OpenAPI (a widely adopted language used to describe web APIs). API-Spector presents several significant contributions, including: (1) novel methods of processing and extracting key information from OpenAPI specifications, (2) innovative feature extraction techniques that are optimized for the highly technical API specification domain, and (3) a novel log-linear probabilistic model that combines multiple signals to retrieve relevant and high quality OpenAPI specification components given a query specification. We evaluate API-Spector in both quantitative and qualitative tasks and achieve an overall of 91.7% recall@1 and 56.2% F1, which surpasses baseline performance by 15.4% in recall@1 and 3.2% in F1. Overall, API-Spector will allow developers to retrieve relevant OpenAPI specification components from a public or internal database in the early stages of the API development cycle, so that they can learn from existing established examples and potentially identify redundancies in their work. It provides the guidance developers need to accelerate development process and contribute thoughtfully designed APIs that promote code maintainability and quality.
翻译:在为大型项目设计新的API时,开发者需要做出明智的设计选择,以便其代码基础能够可持续地增长。为了确保新的API组件的设计良好,开发者可以从现有的API组件中学习。然而,由于缺乏标准化的方法来比较API设计的设计设计,使得这种学习过程的比较过程既耗时又困难。为了填补这一差距,我们根据我们的知识,开发了API-Spectorer,这是第一个API至API规格建议引擎之一。API-Spectories检索了以OpenAPI(一种被广泛采用的语言,用来描述网络API)编写的相关规格组件。 API-Spectoration提供了一些重要的贡献,包括:(1) 新的处理方法和从OpenAPI规格中提取关键信息的方法,(2) 用于高技术性API规格域域的创新性地采掘技术,以及(3) 将多种信号结合起来以检索相关和高质量OpenAIPI规格组成部分的新的逻辑-线性预测模型。 我们评估了API-SPI的定量和定性任务,并实现了总体91.7%的回顾@1 和56.2AF1 级的快速化的系统化的进度,从而可以将恢复现有进度的进度的进度,从而恢复为15%的进度。