To effectively address the complexities of the application domain, IoT systems require an appropriate modeling language and a structured analysis method that guide business analysts and process designers. In this context, a requirements analysis (RA) approach using the i* 2.0 modeling language within a model-driven framework is proposed. The components have been adapted to align with the specific terminology of IoT systems. To illustrate the approach, an application example is presented that focuses on the integration of IoT devices for air quality monitoring. By detailing this methodology, this research ensures transparency and reproducibility, facilitating its adoption in similar contexts.
To further enhance the sustainability of IoT systems, the proposed framework integrates goal-oriented requirements analysis with MDD, providing a structured approach to linking user goals with the corresponding system actions required to achieve them. This is achieved by utilizing (i) task elements from the i* modeling language to analyze the impact of each device action and (ii) goals and sub-goals (quality attributes) to ensure a user-centric orientation in the requirements analysis. As a result, the system dynamically selects and executes device actions based on the current environmental state and the intended goals, enabling context-aware decision making.
Designed for non-technical end users, the framework leverages the i* modeling language, which offers straightforward semantics and intuitive reasoning mechanisms, ensuring ease of adoption with a short learning curve. This approach provides a comprehensive overview of the IoT system while maintaining a strong user focus. End users can define and express their desired states in the smart environment through various interaction modes, including web-based applications, voice commands, or mobile applications, all of which are incorporated into the modeling process. Furthermore, the framework is inherently adaptable, allowing users to customize their goals through the user interface without requiring technical expertise or direct manipulation of the system logic.
The proposed methodology for developing sustainable IoT systems integrates GORE and MDD through a three-stage transformation process. The first stage involves defining the i* RA model, capturing the objectives and dependencies of the system. In the second stage, model-to-model (M2M) transformation rules are applied using Query/View/Transformation (QVT) to convert the i* RA model into a UML class diagram, ensuring a structured representation of system components. Finally, in the third stage, a model-to-text (M2T) transformation is performed using Acceleo to generate Python source code from the UML class diagram, facilitating the implementation of the IoT system. The following sections provide a detailed explanation of this transformation process.
4.2. Application Example: IoT System for Monitoring Air Quality
This subsection presents an example application of the proposed requirements analysis approach, utilizing the i* 2.0 modeling language, for IoT systems. The example is structured as a User Story, which serves as a general and informal description of a software feature from the perspective of the end user. The primary objective of a User Story is to convey the value that a software feature provides to its intended users. Although “customers” typically refer to external end users, in this context, they may also include internal stakeholders, such as colleagues or teams within an organization who rely on the system. User stories are formulated as concise statements in plain language that clearly define the expected results and benefits of the system’s functionality.
4.2.1. User Story: Integration of IoT Devices for Air Quality Monitoring
Consider a scenario in which a homeowner, concerned about environmental health, seeks to implement an IoT-based system to monitor indoor air quality. Such a system would enable proactive measures to improve air quality and maintain a healthy living environment for the home. The key features of this system include the ability to receive customized alerts and seamless integration with other smart home devices, ensuring informed decision making and improved indoor air management.
4.2.2. User Story
As a homeowner concerned about environmental health,
I want to integrate IoT devices to monitor indoor air quality
To obtain real-time information on pollutant levels and take proactive measures to improve indoor air quality.
4.2.3. Acceptance Criteria
Air Quality Sensors: The application should be able to connect and recognize multiple IoT-based air quality sensors. Sensors must measure critical parameters, such as particulate matter, CO2, humidity, and temperature.
Real-Time Visualization: The application should provide an intuitive interface for real-time visualization of the data collected by the sensors. Air quality levels should be clearly represented.
Customized Alerts: It should be able to set custom thresholds for each parameter and receive real-time alerts if the levels exceed these thresholds.
Data History: The application must store and display a history of air quality data to enable long-term analysis. Users should be able to access detailed reports on trends and changes in air quality.
Integration with Smart Systems: The application should be compatible with smart home systems, such as thermostats and air purifiers, to respond automatically to air quality data.
4.2.4. I* Requirements Analysis Model
The i* RA model detailed in
Figure 1 illustrates the example presented in
Section 4.2, where the i * hybrid view integrates SD/SR perspectives for the IoT environment in the application example. The requirements analysis model comprises three actors: The user, representing the end user in the User Story, which has the goal of “home air quality monitoring”. The second actor is the Mobile App, the software through which the user can access real-time information on pollutant air levels in their house. The third actor, central to this example and further explained, is the IoT System, which serves as the core of the IoT of the User Story introduced in
Section 4.2.1. According to
Section 4.1.1, the i* 2.0 language element representing the IoT system is the actor element labeled “IoT”. The goal of the system is “to obtain air information” and remember that a goal serves as an articulation of the intended outcome or accomplishment that a system or software is designed to achieve. These goals encapsulate the overarching objectives that stakeholders strive to attain by utilizing a system. In this case, the goal was defined according to the User Story from
Section 4.2.1, which states that the end user in the “I Want” from the User Story wants to integrate IoT devices to monitor indoor air quality. This is the main goal; if this goal is satisfied, it will help to “improve air quality” since it will help the end user to make a decision support. To be fulfilled, it is necessary to satisfy two other goals: “establishing network connection” and “calculating sensor values”. The goal “establish network connection” can be achieved in two forms (goals): “establish wired connection” or “establish wireless connection”. This is represented by the connectors “OR Refinement”. In this context, the goal “establish wired connection” allows for a reliable connection, as indicated by the quality element and the connection named contribution type “make” (expressing that “the source provides…”), which also affects “easy connection” since it is more complicated for the end user to establish a wired connection than a wireless one. In contrast, the goal of “establishing wireless connection” is the opposite. To fulfill the goal “calculate sensor values” (linked to the main goal by means of a refinement link, where the fulfillment of at least one child makes the parent fulfill), it is necessary to obtain the ID of the sensor (thing) through the service “get sensor identifier.” This, in turn, requires fulfilling one of the two options: the service “read ID sensor” or “read another sensor identifier.” These two services are connected through the “NeededBy” relationship, which links a service (task) with a thing (resource) and indicates that the actor IoT system needs the thing (resource) to execute the service (task). The things in this example are “humidity sensor”, “CO
2 Sensor”, and “temperature sensor,” each of which have attributes such as “turn on”, “off”, and “restart” (which can be personalized as they are labels).
4.2.5. QVT for Model-to-Model Transformations
QVT is a model-to-model transformation language, with which it is possible to define a set of transformation rules to convert the i* RA model into a UML class diagram. The i* model will be transformed into a UML class structure that represents the classes, attributes, and relationships needed for the IoT air quality monitoring system.
To define a set of QVT transformation rules (model-to-model) for generating a UML class diagram from the i * RA model of an IoT system for air quality pollution monitoring, it is necessary to break down the RA model into specific components that need to be transformed into class diagram elements. The transformation process must consider key aspects of sustainability, including energy efficiency, real-time data processing, and scalability. These rules will guide the process of converting the i* RA model to a class diagram, ensuring that the system adheres to these principles while focusing on achieving the goals of the IoT system. The QVT transformation rule will map the actors in the i* model to the classes in the UML model. Each actor in the i* model corresponds to a UML class that encapsulates the behavior and responsibilities of the actors in the IoT system. The goals in the i* RA model will be transformed into class attributes or operations. The services and tasks in the i* model will become methods or associations in the UML class diagram. The resources (e.g., sensors) will also be transformed into classes or attributes. The decomposition of the i* RA model is detailed below.
Actors:
- -
User (end user interacting with the system).
- -
MobileApp (software for accessing data).
- -
IoTSystem (the core system processing sensor data).
Goals:
- -
Monitor air quality (main goal).
- -
Improve air quality (outcome goal for the system).
- -
Establish network connection (connectivity goal).
- -
Calculate sensor values (measurement goal).
Tasks/Services:
- -
Get sensor identifier (for identifying the sensor).
- -
Read sensor data (reading from IoT sensors).
Resources:
- -
Humidity Sensor.
- -
CO2 Sensor.
- -
Temperature Sensor.
The transformation rules are discussed next.
Rule for Transforming i* Actors to UML Classes: In the i* model, actors represent entities that interact with the system (e.g., User, MobileApp, IoTSystem, etc.). These actors will be transformed into UML classes, see QVT rule in Listing 1.
Listing 1. QVT rule actor2Class |
![Applsci 15 05826 i010]() |
Rule for Transforming i* Goals into UML Class Attributes: Goals are the intended outcomes of the system. They will be represented as attributes of the corresponding classes in the UML diagram, see QVT rule in Listing 2.
Listing 2. QVT rule goal2Attribute. |
![Applsci 15 05826 i011]() |
Rule for Transforming i* Tasks/Services to UML Methods: Tasks or services in the i* model will be transformed into methods in the corresponding UML classes, see QVT rule in Listing 3.
Listing 3. QVT rule task2Method. |
![Applsci 15 05826 i012]() |
Rule for Transforming i* Dependencies into UML Associations: The dependencies between actors and goals in the i* model will be transformed into associations in the UML diagram, see QVT rule in Listing 4.
Listing 4. QVT rule dependency2Association. |
![Applsci 15 05826 i013]() |
Rule for Transforming i* Resources to UML Classes: Resources (e.g., sensors) will be converted into UML classes representing the individual sensor components, see QVT rule in Listing 5.
Listing 5. QVT rule resource2Class. |
![Applsci 15 05826 i014]() |
The transformation process follows a structured execution flow comprising four primary phases: Initialization, Matching, Execution, and Completion.
In the Initialization Phase, the source iStar model, containing resource elements, is loaded, and the target UML model is initialized. In addition, transformation traceability links are established to maintain consistency between the source and target artifacts. Upon defining the QVT (Query/View/Transformation) rules, their execution generates a UML class diagram that structurally mirrors the iStar model. Specifically, actors are transformed into UML classes, goals into attributes, tasks or services into operations, and resources into specialized sensor classes.
During the Matching Phase, the transformation engine identifies all resource elements within the iStar model. For each resource possessing a resourceName attribute, a corresponding match is generated. Subsequently, in the Execution Phase, every matched resource is processed by instantiating a UML Class in the target model, where the Class’s name attribute is assigned the value of the resource’s resourceName. Traceability information is recorded to ensure bidirectional model synchronization.
Finally, the Completion Phase performs essential post-processing tasks: the target UML model is finalized, transformation trace metadata persist, and model validation is conducted to verify structural and semantic correctness.
The model transformation process has been refined to ensure alignment between the conceptual elements of the i* framework and the automated code generation pipeline proposed in our methodology. Specifically, the QVT transformation rules were updated to accurately map the core elements of the i* model to an intermediate Python model, establishing a clear correspondence as follows: Goals are represented by monitoring activities such as “Monitor Air Quality”; Tasks correspond to actuator logic, such as “Activate Purifier”; and SoftGoals are associated with sustainability-related metrics, which are exemplified by “Minimize Energy Consumption”. These mappings allow the intermediate model to retain the semantic intent of the requirements analysis. Subsequently, the Acceleo template was adjusted to interpret the intermediate Python model and to generate the corresponding Python source code. This alignment enhances the fidelity of the model-driven approach and ensures that the generated code accurately reflects the stakeholder intentions and sustainability objectives captured during the early requirements engineering phase. The implementation details of the QVT Operational Engine within the Eclipse Framework, providing insights into its execution mechanics and integration, is presented next in Listing 6.
Listing 6. Implementation of QVT rules in QVT Operational engine. |
![Applsci 15 05826 i015]() |
![Applsci 15 05826 i016]() |
The QVT operational rules form the backbone of the model-to-model transformation process within the GORA framework. These rules are applied to translate high-level i* models, representing stakeholder goals, tasks, and dependencies, into a structured platform-independent model (PIM) that serves as the intermediate representation for subsequent code generation. Each QVT rule operates on defined metamodel elements of the i* framework. For example, a rule may transform a SoftGoal into a monitoring condition or map a Task to a specific logic block or function. Dependencies between actors and tasks are resolved into publish/subscribe relations, which later become MQTT topics and handlers in the generated code. Transformation rules ensure semantic consistency by preserving intentional elements from the requirements phase and by embedding traceability links across the generated model.
The QVT transformations include mapping rules, such as converting actors into system components, mapping tasks and SoftGoals into conditional logic, translating resources into input/output streams (e.g., sensor/actuator channels) and representing dependencies as message exchange patterns. These transformation rules are implemented in a way that is both deterministic and traceable, ensuring that any changes in the i* model will result in predictable and verifiable changes in the generated PIM. Critically, the encoding of soft sustainability-related goals—such as energy efficiency, reduced latency, and resource optimization—into QVT mappings aligns the transformation process with sustainable IoT system design. This allows developers to systematically incorporate sustainability constraints and objectives early in the development process and maintain them throughout the software lifecycle.
QVT transformation guarantees that the design intent captured at the goal level is preserved and enforced throughout the development pipeline, enabling automatic, verifiable generation of source code that reflects the high-level objectives of sustainability, efficiency, and responsiveness in IoT environments.
4.2.6. Acceleo for Model-to-Text Transformations
Acceleo is a model-to-text transformation language that can generate code from a UML class diagram (or any other model). The Acceleo template reads the UML classes and generates Python classes, methods, and attributes, focusing on the sustainability goals of the IoT system (energy efficiency, real-time processing, and scalability).
For this proposal, it is necessary to define the Acceleo template (these templates are written in OCL (Object Constraint Language) and are used to generate the output). In this step, it is needed to define an Acceleo template that reads the UML model class diagram and generates corresponding Python classes. Next, we detail the fragment of the Acceleo template defined. This transformation loops over each UML class from the class diagram and generates a Python class. For each class, we generate the attributes (as Python class variables) and operations (as Python methods). After defining the Acceleo template, it is necessary to run the transformation to generate Python code. This will generate Python classes corresponding to the UML class diagram generated earlier.
The template generates Python classes for each UML class, where attributes are mapped to Python variables and operations are transformed into corresponding Python methods. The generated code adheres to key sustainability principles to enhance system efficiency and performance. First, energy efficiency is delivered through asynchronous processing or event-driven mechanisms for real-time data collection. Second, real-time data processing is ensured by implementing methods like get_sensor_data(), which are designed to minimize latency and improve responsiveness. Finally, scalability is achieved by structuring the Python code to support seamless cloud integration and the addition of new sensors with minimal modifications, ensuring adaptability to evolving IoT requirements.
The Acceleo template is presented next. The proposed transformation yields Python class implementations corresponding to each conceptual element of the model: actors (including User, MobileApp, and IoTSystem classes); goals (represented as class attributes such as air quality monitoring parameters); tasks and services (implemented as methods like get_sensor_data()); and resources (encapsulated as sensor classes including HumiditySensor, CO2Sensor, and other relevant sensor types). This object-oriented mapping preserves the structural and behavioral semantics of the original model while providing executable implementations that maintain the intended system functionality (see Listing 7).
Listing 7. Acceleo model to text transformation template. |
![Applsci 15 05826 i017]() |
![Applsci 15 05826 i018]() |
The Python source (excerpt from the Acceleo template output) code for the IoT system is detailed below (see Listing 8).
Listing 8. Python source code generated from Acceleo template. |
![Applsci 15 05826 i019]() |
![Applsci 15 05826 i020]() |
The Python source code produced through the GORA framework is the result of the MDD pipeline guided by goal-oriented requirements analysis. The code is designed to operate within an IoT system architecture, where it processes sensor data, evaluates environmental conditions, and triggers actuation responses based on declarative goals captured in the requirements model.
The generated code exhibits an event-driven modular structure that includes clearly defined components for sensor data acquisition, condition evaluation, actuation logic, and log. MQTT is used as the communication middleware, enabling low-latency asynchronous message exchange between simulated sensors, broker, and actuator logic. The program is initialized by subscribing to predefined MQTT topics corresponding to environmental sensor readings. Upon receiving a new message, the payload is parsed and key environmental indicators, such as temperature, humidity, or air quality index, are extracted. These values are then evaluated against threshold-based decision rules that originate from the soft goals and operational tasks defined in the i* model. For example, if a temperature value exceeds a defined comfort threshold, a fan actuation message is published to a specific topic. Additionally, the code includes precise time stamping and logging mechanisms for each decision event, enabling detailed tracking of system latency and behavior over time.
The structure of the code adheres to best practices in software engineering, such as separation of concerns and high cohesion, which contributes to its reduced memory usage and enhanced maintainability. This efficiency, along with energy-conscious design patterns enforced through automated transformations, directly supports the goals of sustainable IoT systems. Specifically, energy consumption is reduced through optimized actuation logic, while system responsiveness ensures timely intervention, minimizing unnecessary resource usage. By enabling automatic translation of high-level sustainability goals into optimized executable code, the GORA framework demonstrates a concrete path toward environmentally responsible IoT solutions.
To validate the model-driven approach, the generated Python code must undergo rigorous testing within the target IoT environment. This testing process involves (1) integration testing of Python classes within the complete system architecture; (2) verification of real-time data processing capabilities, energy-efficient operation, and scalability under increasing sensor loads; and (3) continuous monitoring of sustainability metrics, including power consumption profiles and response time characteristics under various operational scenarios. The proposed methodology, which combines QVT for model-to-model transformations with Acceleo for model-to-text transformations, establishes a robust framework that bridges GORE with MDD. This dual transformation approach systematically integrates sustainability concerns—particularly energy efficiency, real-time performance, and architectural scalability—into both the design models (through UML extensions) and their corresponding Python implementations. Consequently, the methodology ensures that sustainability objectives are maintained throughout the system’s lifecycle, from initial requirements specification to operational deployment and evolution.
The generated Python code represents the classes, attributes, and operations defined in the UML model, facilitating the implementation of the IoT system. Once the Python code is generated, it can be integrated and tested by connecting to sensors, collecting data, and monitoring air quality. The transformation process ensures that the IoT system remains sustainable by maintaining traceability between requirements (i * RA model), design (UML class diagram), and code (Python source code). Furthermore, this process can be extended for future iterations, ensuring that, as new requirements are identified, the system can be easily updated by transforming the updated models using QVT and generating new Python code with Acceleo. This iterative process guarantees an efficient, MDD-based approach to the development of IoT systems, making it adaptable and sustainable for future enhancements.
It is crucial to emphasize that end users interacting with devices are confined to thinking about the various actions these devices offer (e.g., turning it on, obtaining the temperature, etc.). Different devices present diverse actions, and the same action may exhibit different behaviors on various devices due to a lack of semantic interoperability. In the current realm of IoT systems, when programming smart devices, users must select the device, specify certain parameters or conditions, and then execute a specific action on the device. As a result, the operation produces an effect, such as a reduction in the temperature or the obtaining of CO2 sensor values. The end user is clearly interested in defining the effect rather than devising the sequence of actions needed on different devices to achieve the desired result. The core concept behind goal-oriented interaction is to empower end users to articulate the overall effect (goal), such as “obtain air quality information”, rather than requiring users to provide a list of actions resulting in the effect. Therefore, with this proposal, it becomes possible to visually represent the “big picture” of an intelligent environment, thereby considering the end user, the software, and the IoT system (devices, etc.) to enhance understanding and analysis of what is necessary to design and implement for satisfying user goals and expectations.