论文标题
评估物联网应用的REST API的语言质量
Assessing the Linguistic Quality of REST APIs for IoT Applications
论文作者
论文摘要
物联网(IoT)是一项不断增长的技术,依赖于连接的“事物”,该技术从同行设备收集数据并通过API(应用程序编程接口)将数据发送到服务器。这些API的设计质量对其可理解性和可重复性有直接影响。这项研究重点介绍了物联网应用的REST API的语言设计质量,并通过在IOT应用中对REST API中的语言模式和对抗模式进行检测来评估其语言质量。语言反图被认为是在标识符的命名,文档和选择中的糟糕实践。相反,语言模式代表了API设计的最佳实践。语言模式及其相应的对抗图案是对比对的。我们提出了SARAV2(REST API版本第二版的语义分析)方法,以对IoT应用程序进行REST API的句法和语义分析。基于SARAV2方法,我们开发了静止的工具,并从经验上验证了九种语言反系列的检测结果。我们为物联网应用分析了19个REST API。我们的检测结果表明,语言反图案很普遍,而静止的工具可以在REST API中检测语言模式和对Antipatterns的物联网应用,平均准确性超过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.