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

评估用于IoT应用的REST API的语言质量

Assessing the Linguistic Quality of REST APIs for IoT Applications

Francis Palma, Tobias Olsson, Anna Wingkvist, Javier Gonzalez-Huerta

摘要:

物联网(IoT)是一种不断发展的技术,它依赖于连接的“事物”,这些“事物”从对等设备收集数据并通过API(应用程序编程接口)将数据发送到服务器。这些API的设计质量直接影响其可理解性和可重用性。本研究重点关注面向物联网应用的REST API的语言设计质量,并通过检测面向物联网应用的REST API中的语言模式和反模式来评估其语言质量。语言反模式被认为是命名、记录和选择标识符方面的糟糕实践。相比之下,语言模式代表了API设计的最佳实践。因此,语言模式及其对应的反模式是对立的对。我们提出了SARAv 2(REST API第二版的语义分析)方法来执行IoT应用程序的REST API的语法和语义分析。基于SARAv 2方法,我们开发了REST-Ling工具,并对9个语言反模式的检测结果进行了实证验证。我们分析了物联网应用程序的19个REST API。我们的检测结果表明,语言反模式是普遍存在的,REST-Ling工具可以检测到用于物联网应用的REST API中的语言模式和反模式,平均准确率超过80%。此外,该工具平均以秒的量级执行语言反模式的检测,即,8.396秒。我们发现,API通常遵循良好的语言实践,尽管存在普遍的不良实践。

英文摘要:

Internet of Things (IoT) is a growing technology that relies on connected 'things' that gather data from peer devices and send data to servers via APIs (Application Programming Interfaces). The design quality of those APIs has a direct impact on their understandability and reusability. This study focuses on the linguistic design quality of REST APIs for IoT applications and assesses their linguistic quality by performing the detection of linguistic patterns and antipatterns in REST APIs for IoT applications. Linguistic antipatterns are considered poor practices in the naming, documentation, and choice of identifiers. In contrast, linguistic patterns represent best practices to APIs design. The linguistic patterns and their corresponding antipatterns are hence contrasting pairs. We propose the SARAv2 (Semantic Analysis of REST APIs version two) approach to perform syntactic and semantic analyses of REST APIs for IoT applications. Based on the SARAv2 approach, we develop the REST-Ling tool and empirically validate the detection results of nine linguistic antipatterns. We analyse 19 REST APIs for IoT applications. Our detection results show that the linguistic antipatterns are prevalent and the REST-Ling tool can detect linguistic patterns and antipatterns in REST APIs for IoT applications with an average accuracy of over 80%. Moreover, the tool performs the detection of linguistic antipatterns on average in the order of seconds, i.e., 8.396 seconds. We found that APIs generally follow good linguistic practices, although the prevalence of poor practices exists.

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

↑