1
Advanced Software EngineeringURL: http://lore.com/Advanced-Software-Engineering-Univaq/
DISIMDep.nt of Information Engineering, Computer Science and MathematicsUniversity of L’Aquila, Italy
LAB on Software Architecture
Vittorio Cortellessa and Henry Muccini [email protected];[email protected]
SEA GroupSEA Group
Copyright Notice
The material in these slides may be freely reproduced and distributed, partially or totally, as far as an explicit reference or acknowledge to the material author is preserved.
SEA GroupSEA Group
Non Functional S.E.Performance modelingPerformance analysis
UML UML ProfilingLab
Intro to SASA Case study SA styleADLs Design Decisions Views/Viewpoints
Software Architecture
UML Extra Functional
Lectures
SEA GroupSEA Group
Problem to be solved
I need a system that: Can detect and predict fire in a building Can communicate to the fire fighters Can communicate to the fire trucks Can route fire trucks towards different fires Can monitor the state of a fire
SEA GroupSEA Group
System usage scenario There is some smoke on the first apartment in the 4th floor, on Avenue de Fortune 26. A smoke sensor detects the smoke, potential source of a fire, and informs a local server. The local server posts the information on-line, and this information is accessible from the fire station. The fire station has a view on all the alarms and warnings happening at the all time. The system monitors the status of alarms and informs the fire fighters about the entity of the fire, the time it started, the area covered by it, and other sensitive information. Based on such information, the system decides where to send the fire trucks (in case only a limited set of fires can be managed in parallel). The fire fighters jump into the fire truck, turn in their onboard computing system, and get information about the fastest way to get to destination. During the trip, they get all possible updates about the state of the fire. Based on this information, they may decide that a second truck is needed, or one is closer to Avenue de Fortune, or that their service is not needed anymore. When the fire fighters arrive to Avenue de Fortune 26, the entire 4th floor is on fire. By using other sensors, they may know how many people is trapped inside the building: this information is displayed on their devices. Fortunately, nobody is inside the building at this time. Before starting extinguishing the fire, the system discovers that there are some gas cylinders on the 6th floor. They first start securing those devices, and in parallel extinguishing the fire on the 4th floor.
SEA GroupSEA Group
Overall Architecting Process
Architectural constraints and requirements
Ideas
Constraints
Req1:..Req2:..Req3:..………
Architectural requirements
C2
C3C1
C4
Software Architecture
Software Architecture
synthesis
C2
C3C1
C4Software Architecture
prototypeEvaluation and Decisions making
SEA GroupSEA Group
Fire Rescue WSN Architecture
Features:• The system has to monitor buildings for humidity, voltage, pressure and
temperature, through WS nodes • Those are related factors to be used to prevent a fire
• Monitored data has to be stored• Statistical information has to be computed• Fire alarms need to be dispatched• Collected data and reports can be accessed via a Web Interface• A management unit receives alarms and warnings, and information to
locate the fire
SEA GroupSEA Group
Fire Rescue WSN Architecture
- The system has to enable quick but effective decisions on how to fight the fire (in order to plan an Intelligent scheduling and resource allocation)
Non Functional Requirements:• All the alarms sent must be received• In the worst case scenario, alarms sent has to be received within 1
second • The Web application and the data must be secure and private• False alarms must be avoided
SEA GroupSEA Group
Class Work
SEA GroupSEA Group
By Next Lecture: readDraw your
architecture
Chapter 1
SEA GroupSEA Group
Main Concerns
Main Design Decisions to be takenWhat to Model?How to Model?Multiple Views Is the produced one a Good architecture?How to use such an architecture?
SEA GroupSEA Group
What to model? (1)
HW/SW/DeploymentComponent Types and InstancesStructural and behavioralComponents’ Nesting and sub-systemsWhat can I model, what I cannot ?Requirements and qualitiesStyles
SEA GroupSEA Group
What to model? (2)
What to model?Which are the high-level components (high level)?Which are the possible configurations (home voting, cabin
voting, …)Components refinementInformation storing and distributionQoS, depending on the configuration (later on)Conflicts among choices (quality conflicts) (later on)What are the architectural-specific decisions?How do they affect the architecture? How the final
product?
SEA GroupSEA Group
Multiple Views
Define an architecture from different viewpoints:Software ConfigurationHardware Configuration Deployment Configuration
Structural Behavioral
Architectural Styles
SEA GroupSEA Group
How to model? (1)
There are three different options:Informal box-and-line notationsFormal Architecture Description LanguageUML
component ElevatorPanel is { state { vport : ViewportType; sub_vports : \set ViewportIDType; } invariant { #sub_vports \eqgreater 0; } interface { prov ip_newvpt: createViewport() : ViewportType;
... req ir_selshp: selectShipment(port : PortID; shp : ShipmentID); } operations { prov op_subvpt: { let vpt : ViewportIDType; pre vpt \not_in sub_vports; post (#~sub_vports = #sub_vports + 1) \and (vpt \in sub_vports); }
...
User1
Router Server
Timer
AlarmUR AlarmRS (c)Check1
Nofunc
Clock
AckSR (c)
AckRU1
User2
AlarmUR1
AlarmUR2
Check2
Check
AckRU2
C1
C3
C4
C2
C5
C4'
SEA GroupSEA Group
How to model? (2)
DrawingPros, cons
Formal languagesPros, cons
Model-based NotationPros, cons
SEA GroupSEA Group
Quality SA
The quality of a SA depends on how well it satisfies functional and non functional
requirements
SEA GroupSEA Group
SA-based Analysis
Assessment:A Software Architecture should be realized in order to comply to requirements
Is my architecture really compliant to certain given requirements?
Conformance:An implementation should conform to the Architectural specification
Is my implementation really compliant to my architectural specification?The SA specification, when assessed, acts as an oracle, describing what expectedAnalysis can start even before the code is available
SEA GroupSEA Group
Software Architecture-level Analysis
Much has been done for SA-level Analysis:Model and Consistency Checking SimulationTesting MonitoringDependence AnalysisPerformance and Reliability AnalysisTradeoff AnalysisComponents CompositionSecurity…
SEA GroupSEA Group
Code Generation from SA specifications
The goal is to generate a skeleton code, reflecting architectural elements and decisionsThe main approaches so far:
AADLAda, C, Java
FujabaMDA approaches and model transformation
JavaAExtension to Java
ArchJavaThe ACME ADL concepts are automatically mapped into ArchJava concepts