Evaluating Test Quality of Python Libraries for IoT Applications at the Network Edge

Zhifei Chen,Chiheng Jia,Lin Chen
DOI: https://doi.org/10.1007/s11276-023-03479-2
IF: 2.701
2023-01-01
Wireless Networks
Abstract:The Internet of Things (IoT) frequently exchange data through the Internet by comprising a complex network of smart devices. However, various vulnerabilities of IoT applications are observed which shall keep IoT as a technology in danger. Therefore, IoT applications should go through rigorous testing at the network edge. Python is widely used for programming IoT devices as well as developing the corresponding back-end at the network edge. Due to the difficulty of static program analysis on dynamic languages, the quality of test code in Python libraries for IoT development faces a serious threat, which in turn affects the performance of IoT applications. In order to evaluate test quality of Python libraries for IoT applications, we propose a test analysis framework named Pysta. It uses a hybrid analysis engine to support the multi-dimensional evaluation of Python test code. Based on Pysta, we then conduct an empirical study on test quality in eight Python libraries which are widely used for IoT development to investigate test code composition, test objects, test co-evolution, and test code smells. The study results reveal the major problems and challenge in the tests of Python libraries for IoT applications, including low naming consistency, single form of assertion, lacking edge tests, low test coverage in large-scale projects, delaying test co-evolution, and various code smells in tests. This work can inspire researchers and developers on how to improve test quality of IoT applications and further reduce security risks associated with IoT systems.
What problem does this paper attempt to address?