Node-RED is a visual tool based on the flow-based programming paradigm and built on NodeJS, which is used for developing IoT systems. In Node-RED, the developer can follow her own personal flavour for wiring devices and online services together, and the same system can be developed in many different ways. Each day, the Node-RED community submits to users novel solutions, and even if there exist frameworks for testing Node-RED flows, they are not supported by a systematic testing technique. Hence, the freedom granted by Node-RED may hinder the understandability of the produced artefacts and the detection of faults.

In this work, we propose a preliminary version of an approach for developing and testing a Node-RED system starting from a UML model of its dynamic and static aspects. A JSON object representing the Node-RED system is generated from the model, while executable Javascript test scripts relying on the Mocha test framework are generated from selected portions of the model, enriched with control points to perform checks over the system properties. We believe that a model produced with our approach may help in the early system validation by detecting faults and deviations from its expected behaviour.