In the last years Node.js has emerged as a framework particularly suitable for implementing lightweight IoT applications, thanks to its underlying asynchronous event-driven, non blocking I/O model. However, verifying the correctness of programs with asynchronous nested callbacks is quite difficult, and, hence, runtime monitoring can be a valuable support to tackle such a complex task. Runtime monitoring is a useful software verification technique that complements static analysis and testing, but has not been yet fully explored in the context of Internet of Things (IoT) systems. Trace expressions have been successfully employed for runtime monitoring in widespread multiagent system platforms. Recently, their expressive power has been extended to allow parametric specifications on data that can be captured and monitored only at runtime. Furthermore, they can be language and system agnostic, through the notion of event domain and type. This paper investigates the use of parametric trace expressions as a first step towards runtime monitoring of programs developed in Node.js and Node-RED, a flow-based IoT programming tool built on top of Node.js. Runtime verification of such systems is a task that mostly seems to have been overlooked so far in the literature. A prototype implementing the proposed system for Node.js, in order to dynamically check with trace expressions the correct usage of API functions, is presented. The tool exploits the dynamic analysis framework Jalangi for monitoring Node.js programs and allows detection of errors that would be difficult to catch with other techniques. Furthermore, it offers a simple REST interface which can be exploited for runtime verification of Node-RED components, and, more generally, IoT devices.
翻译:在过去几年中,Norde.js已经成为一个特别适合实施轻量级 IoT 应用程序的框架,这个框架特别适合实施轻量级 IoT 应用程序, 因为它是非同步事件驱动的, 没有屏蔽 I/ O 模型。 但是, 核查程序是否正确, 使用无同步的嵌套回拨回调相当困难, 因此, 运行时间监测可以成为应对这一复杂任务的宝贵支持。 运行时间监测是一种有用的软件核查技术, 补充静态分析和测试, 但尚未在Think( IoT) 系统中充分探索。 在广泛的多试剂系统平台上运行运行运行的运行时间监测时, 已经成功地使用了跟踪表达方式。 运行时间性功能可以使用语言和系统, 通过事件域域和类型的概念, 将参数追踪表达方式作为运行正常时间监测程序的第一步, 运行基于流动的 IT 程序工具的运行时间工具, 在 Ndeede.js 上运行的运行时间性测试功能, 一般来说, 运行时间核查系统运行到动态跟踪工具的运行过程。