Enhancing Embedded Software in the Internet of Things Domain: Exploring JavaScript on Resource-Constrained Devices - Oliveira, Fernando Luis (2023)
Embedded software development for the Internet of Things (IoT) has predomi nantly centered on compiled programming languages, such as C and C++, with C being the most widely used. However, the C language has downsides, including lack of object orientation, absence of exception handling, no garbage collection, manual memory management, and other aspects that can make software develop ment challenging, considering the increased complexity of the embedded software requirements. In contrast, interpreted languages like Python and JavaScript (JS) have emerged as alternatives to improve the software quality and abstraction level of applications. Although interpreted languages can bring advantages to embedded software, such as flexibility and ease of use, their execution model (interpretation) can demand higher resource consumption, restricting their use in resource-constrained devices. This study investigates methods to enhance the performance of embedded software to reduce resource consumption in the IoT context, focusing on devices with limited resources. In particular, we chose JavaScript as an alternative to C language and performed investigations to enhance its performance. To do that, we begin with a systematic literature review to understand the relationship between JS and IoT. Then, we analyzed the JavaScript language to understand its impact on constrained devices and performed experiments using benchmarks and real-world applications. As a result, we produced a set of guidelines to improve code quality, a tool (JSGuide) to detect code smells, and developed a framework (JSEVAsync) based on asynchronous functions to help developers build better-embedded solutions. Our findings show that using an interpreted language in embedded software development is feasible and improves design-time metrics, such as maintainability, readability, and code reuse.