一句话:提出 VirtualHAB,仅用 openHAB 规则文件自动构建数字模型,以在无物理设备下测试和验证规则。
openHAB 是广泛使用的智能家居平台,其自动化高度依赖规则。随着设备与规则数量增长,在不影响物理环境的前提下测试规则愈发困难。本文提出 VirtualHAB,仅以规则文件为输入自动模拟 openHAB 系统的数字模型:它从规则内部逻辑或系统交互中抽取对物品(item)的直接或间接引用,并虚拟创建这些 item,从而得到可用于软件测试与评估的数字模型。作者比较正则表达式与 LLM 解析器两种 item 抽取方法,发现正则更快,但 LLM 解析器在正确创建 item 上准确率高 35.52%;结合 LLM 解析器的 VirtualHAB 在动态测试规则时创建数字模型的准确率达 90.14%。
Open Home Automation Bus (openHAB), a highly used smart home platform, heavily relies on rule-based automation. Testing and validating rules without affecting the physical environment becomes difficult as the number of devices and rules increases. We present VirtualHAB - a tool to automatically simulate a digital model of an openHAB system using only its rule files as input. VirtualHAB scrapes the rules file for direct or indirect references to items through internal logic or system interactions. By creating the extracted items virtually, we get a digital model that can be used for software testing and evaluation. Extraction of items from rule files is tested with 2 methods: regular expressions and using an LLM parser. We show that while using regular expressions is faster, the LLM parser outperforms it by 35.52% in accurately creating the right items. Furthermore, we show that VirtualHAB with the LLM parser achieves an accuracy of 90.14% in creating a Digital Model for dynamically testing rules.