LAB01: SWD392 -SU25
Duration: 90 Minutes
Instructions:
● You are a software engineer at "GreenTech Solutions". Your current project is to develop
a new Smart Farm Monitoring System that supports agricultural automation.
● Use your knowledge and provide real-world assumptions where needed.
● Draw all diagrams using a UML tool. Submit your diagrams and written answers in a
single document.
● The language level of this exam is designed to be clear and simple.
Questions 1. (3.0 points)
Business Scenario: The system models how smart devices are organized in a farm. A Farm
contains multiple Zones (e.g., greenhouse, rice field). Each Zone consists of various Sensors. A
Sensor is either a TemperatureSensor or a MoistureSensor, each with different properties and
behavior. A Zone cannot exist outside of a Farm, and a Sensor belongs to exactly one Zone.
● Task: Draw a Class Diagram at the entity level (showing only class names, no
attributes).
o Your diagram must show the relationships between Farm, Zone, Sensor,
TemperatureSensor, and MoistureSensor.
o You must correctly show aggregation, composition,
and generalization relationships, including multiplicities.
Questions 2. (2.0 points)
Business Scenario: A farmer wants to view real-time sensor data. The farmer logs into the
MonitoringDashboard (a boundary object). The dashboard sends a request to the
SensorDataController (a control object), which checks the sensor’s status using the
DeviceHealthService (a service object). It then retrieves the latest readings from the
SensorRepository (an entity object) and displays them.
● Task: Choose the best UML diagram (Sequence or Communication) to clearly show
the step-by-step, time-ordered flow of messages for this process. Draw the diagram you
have chosen. You must label each object with its correct application logic stereotype
(«boundary», «control», etc.).
Questions 3. (1.0 points)
Business Scenario: A moisture sensor has a lifecycle. It starts in the Inactive state. When the farmer
turns it on, it moves to the Active state. If the battery is low, it transitions to the LowBattery state.
If disconnected, it moves to the Disconnected state. After recharging or fixing the connection, it
returns to the Active state.
● Task: Draw a Statechart Diagram for a MoistureSensor object.
o Your diagram must show all the states: Inactive, Active, LowBattery,
Disconnected.
o Clearly label the events that trigger the state changes and the actions that occur.
Questions 4. (1.0 point)
Task: Propose a suitable software architecture for the Smart Farm Monitoring System.
● Name the architecture you choose.
● Explain why this architecture is a good choice for this project. Then, list one key
advantage and one key disadvantage.
Questions 5. (1.0 point)
Business Scenario: The system allows farmers to receive notifications based on different criteria:
temperature threshold, soil moisture level, or scheduled timing. Each type of notification is
handled differently. The notification system must allow these algorithms to be swapped or added
without changing the notification interface.
● Task: Identify and name a specific Design Pattern that allows you to define a family of
algorithms, encapsulate each one, and make them interchangeable. Explain why this
pattern is the best solution for this specific problem.
Questions 6. (1.0 point)
Business Scenario: The smart farm system is used by multiple roles:
• Farmers can log in, view sensor data, set thresholds for alerts (e.g., moisture < 30%), and
view reports.
• Technicians can maintain sensors and diagnose problems.
• System Admins manage user accounts and monitor system uptime.
Task: Draw a Use Case Diagram showing all actors and their main use cases.
Use <<include>> and <<extend>> relationships where appropriate.
Organize your diagram for clarity.
Questions 7. (1.0 point)
Business Scenario: The Smart Farm Monitoring System is deployed across several hardware and
software nodes:
• IoT sensors deployed in zones of the farm
• Edge Device (Raspberry Pi or local server) collects sensor data
• Cloud-based Application Server handles business logic and APIs
• Database Server stores all sensor readings and user info
• Users access the system through Mobile App or Web Dashboard.
Task: Draw a Deployment Diagram showing the main nodes, software components deployed on
them, and communication paths between them.
END OF EXAMINATION