# A TDD Framework for Automated Monitoring in Internet of Things with Machine Learning +
## 1 Introduction  
The Internet of Things (IoT) is a critical infrastructure necessary to the deployment of large projects with huge potential to change whole business sectors. Things present in IoT environments are responsible for measuring the variables of the physical world and share it across the network. Either a local network or the Internet can be used to connect things and generate a connected environment that can be measured and controlled. Sensors embedded in these things enable the measurement of temperature, pressure, oxygen levels, presence, and others that are applied to projects related to Smart Cities, Industry 4.0, and Big Data. Consider an example of IoT application in the remote operation field. Workers operating remotely on hazardous situations and dangerous scenarios, with reduced costs and safety guaranteed by the distance and the real time monitoring [1]. IoT could be the bridge between the IT and the operations ground using the data generated in the production process [2]. The non-functional requirements of the underlying IoT infrastructure are fundamental to enable the business value generation in this example. Moreover, critical applications, such as health, finance, and safety, require higher levels of quality. These areas are good examples of critical areas that require robust and fault tolerant systems with high availability, as they are used in fields that are crucial for the function of society, and unavailability events in these areas can be dangerous and expensive. As analyzed by IBM in 1998 [3], the unavailability of brokerage operations and credit cards operations had an average combined cost of USD 9.1 million per hour. Considering an IoT architecture organized in layers as described in the reference architecture IoT-A [4], the applications, such as the Smart City, are present in the data layer, corresponding to the Application and Presentation layers of the traditional OSI model. The underlying layers, End to end, Network and ID, Link, and Physical, which correspond to the Session, Transport, Network, Data Link, and Physical layers of the OSI model. Similar to how the Internet works, the underlying layers are essential for the smooth operation of the applications, and we consider that these layers embed the non-functional requirements that shape quality levels necessary to critical applications. The successful deployment of IoT depends on how these non-functional requirements are modeled and implemented to provide a reliable and trustworthy infrastructure that enables the IoT to create value to businesses and people. However, the deployment of traditional approaches to the IoT domain is not trivial. The IoT integrates constrained devices with energy, processing, memory, and communication limitations, and it also employs heterogeneous communication protocols, devices, and architectures, such as those that are edge and cloud-based. A motivation for this work is relative to the application of a similar protocol to the Simple Network Management Protocol (SNMP) [5] to manage IoT devices considering monitoring procedures. In this article, we consider the following research question: \"is it possible to assess if non-functional requirements are being supported by an IoT system in real time in an autonomous way?\". The objective is to monitor IoT modules with the goal of increasing its Testability. Testability is considered a sub-characteristic of the Maintainability non-functional characteristic as described in ISO25010 [6]. The problem considered within the scope of this paper is the lack of automated testing and monitoring of IoT devices under development. Such low Testability hinders the quality aspects of the resulting IoT system. For example, if an IoT device violates its resource utilization in the development phase, the resulting IoT product may present unavailability events when deployed.