Icse 99 Tutorial
Icse 99 Tutorial
of Software Architecture
Robert T. Monroe
Carnegie Mellon University FreeMarkets Corp.
5000 Forbes Ave. One Oliver Plaza
Pittsburgh, PA 15213 Pittsburgh, PA 15222
bmonroe@cs.cmu.edu bmonroe@freemarkets.com
• Descriptions of software
systems often include a
section on “the architecture
of this system”
• Usually informal prose plus
box-and-line diagram
• Lots of appeal to intuition
• Little precision, rarely
formal
Next Section
Architecture Programs
interactions among parts implementations of parts
structural properties computational properties
declarative operational
mostly static mostly dynamic
system-level performance algorithmic performance
outside module boundary inside module boundary
composition of subsystems copy code or call
libraries
Architecture
Reduce maintenance
costs, directly and
Code/Integ
• Clarify intentions indirectly
• Make decisions and
Test/Accept
implications explicit
• Permit system-level
analysis Maintenance
Requirements
Discovery
Review Architecture
High-Level
Design
Source:
Joe Maranzano
ATT Bell Labs Architecture Low-Level
Review Design
Modeling & Analysis of Software Architecture ©1998 Robert T. Monroe 12
Elements of Architectural Descriptions
Problem Description:
"The KWIC index system accepts an ordered set
of lines, each line is an ordered set of words,
and each word is an ordered set of characters.
Any line may be ‘circularly shifted’ by
repeatedly removing the first word and
appending it at the end of the line.
The KWIC index system outputs a listing of all
circular shifts of all lines in alphabetical
order."
On the Criteria for Decomposing Systems into Modules. David Parnas. CACM, 1972
Output
Input
Medium
Medium
Input Output
Alphabetic
Characters Circular Shift Shifts
Input Output
Medium Advantage: Information hiding Medium
simplifies implementation changes.
Modeling & Analysis of Software Architecture ©1998 Robert T. Monroe 17
KWIC: Event Solution
Input Output
Medium Medium
Lines Lines
Input Circular
Input
Medium Shift
Pipe
System I/O
Alphabetizer Output Output
Medium
• Change in Algorithm
> Eg., batch vs incremental
• Change in Data Representation
> Eg., line storage, explicit vs implicit shifts
• Change in Function
> Eg., eliminate lines starting with trivial words
• Performance
> Eg., space and time
• Reuse
> Eg., Sorting
Shared
Memory ADT Events Dataflow
Change in Algorithm _ _ + +
Change in Function + _ + +
Performance + + _ _
Reuse _ + _ +
system
connector
component
port role
• Components
> computational elements
• Ports
> interface points for components
• Connectors
> interactions between components
• Roles
> interface points for connectors
• Systems
> graphs of component and connectors
System SimpleClientServer = {
Component viewer : ClientT;
Component database : ServerT;
System
Connector conn : RPCT;
Attachments = { Description
viewer.sendReq to conn.caller;
viewer.receiveReq to conn.callee; viewer
};
};
Topology database
Description
Architectural Structure:
Hierarchical Descriptions
• Representations
> describe subsystems
> may be architectural or external
• Abstraction mappings
> relate the inside and outside of architectural
representations
> bindings are special case
Configuration
Component Representations
...
if(x>0) ...
{ ...
write(out);
x--; ...
} ...
map
representation
System SimpleClientServer = {
Components { viewer1 : ClientT; viewer2 : ClientT; }
Component database : ServerT;
Connector conn : RPCT;
Attachments = { … };
Glue =
Glue =
Glue =
> Consistency
» Do the parts fit together?
> Completeness
» Are parts missing?
> Refinement
» Can one architecture be substituted for another?
> Verification
» Does an implementation conform to the architecture?
> System-wide behavior, performance, reliability, etc.
» What is the aggregate behavior of a system, given the
behaviors of the parts?
> Evaluating design choices and trade-offs
Connector Faulty
Role Client = (requestresultClient) §
Role Server = initialize Operate...
Glue = Client.initializeServer.initializeGlue
[] Client.requestServer.requestGlue
...
Modeling & Analysis of Software Architecture ©1998 Robert T. Monroe 46
Consistency Check 2: Paused on Join
Role
JoinFed = joinFedExecution FedRunning
Glue
HandlePauseS = i: S [] Fedi.requestPause
( i: S ; Fedi.schedulePause §) ; HandlePauseS
Modeling & Analysis of Software Architecture ©1998 Robert T. Monroe 47
Paused on Join
Federate Federate
(1) joinFedExecution
(2) requestPause
(3) schedulePause
(4) pauseAchieved
(5) joinFedExecution
(6) requestPause
RTI
Federate Federate
(1) joinFedExecution
(2) requestPause
(3) schedulePause
(4) pauseAchieved
(5) joinFedExecution
(6) requestPause
(7) schedulePause
RTI
(receive update)
(commit to send)
reflectAttrValue
RTI
Incomplete! Complete
Modeling & Analysis of Software Architecture ©1998 Robert T. Monroe 51
Analysis: Refinement & Verification
Abs Abs
• Measurement
> Most accurate; modifications difficult
> Requires existing system, workload
• Simulation
> Accuracy and ease of modifications vary
> Requires existing simulator, workload
• Analytical model
> Back-of-the-envelope accuracy in design
phase
> Nontrivial systems require nontrivial
calculation; analysis tools can help.
> Simulation
> Guesstimate i-ui
m-ui p-ui
Component microbiology-db = {
p-db-2
Property localPerformance = [
microbiology-db pharmacy-db
replication = 2;
serviceTime = 1000ms;
Hospital MIS System
outputMessagePaths = […];
];
Property computedPerformance = [
…?
];
};
Modeling & Analysis of Software Architecture ©1998 Robert T. Monroe 60
QN Example: Emergent Global Properties
System hospitalMIS = { …
infectious-diseases-ui microbiology-ui
Property systemPerformance = [ pharmacy-ui
avgResponseTime = 2784ms;
i-ui
avgSystemMsgs = 2.342; ]; m-ui p-ui
trend-tracker simple-server
Component microbiology-db = {
Ports {…}; m-db-2
p-db-2
m-db-1 p-db-1
avgResponseTime = 2143ms;
avgQueueLength = 0.923; Hospital MIS System
avgUtilization = 0.48;
overloaded = false; Tool computes system-wide
]; }; performance properties
}; based on configuration
Example from:
Abd-Allah, Ahmed, “Extending Reliability Block
Diagrams to Software Architectures”, USC
Technical Report USC-CSE-97-501. [AbdAllah97]
R1
... R2
R1 R2 Rn ...
Rn
n n
Rsys Ri Rsys 1 1 Ri
i 1 i 1
Serial Composition Parallel Composition
(after 10 hours)
65.7%
59.5%
...
Domain Wrapper
Translator
C2 Component Internal
Object
Dialog &
Constraints
[From C2 website]
Modeling & Analysis of Software Architecture ©1998 Robert T. Monroe 74
C2 Tools
R-S S-R
• Desired Property
> Global Deadlock-freedom
• One Connector Type
> Buffered Message Passing
• Two Component Types
> Send-then-Receive (S-R)
> Receive-then-Send (R-S)
• Topological Constraint
> No cycles of Receive-then-Send
[Justo94CDS, p. 151]
Si = {
Outi.send Si+1, when 1is
Ini-s.recv Si+1, when s<is+r
Ini-s.recv S1, when is+r
c : Components
Type(c) = R-S Type(c) = S-R
c : Connectors
Type(c) = MessageBuffer
C : P Components |
Cycle(C)
c : Components Type(c) = R-S
Configuration
Configuration
R-S
Component Component
• Any component property is configuration property
• Induction on Component
> Component + component component
• Induction on Connector
> Component + connector component
Style 2
Style 3
Acme
Tools for Acme tool1
ADL-1 representation
Acme
tool2
Tools for
ADL-2 Acme
tooln
Style
Style
Description
Description
Environment
Environment
Aesop
Aesop For
ForThat
That
Generator
Generator Style
Style
Shared
Shared
Infrastructure
Infrastructure
• Multiple views
> How to combine different representations?
• Architectural interchange
> Canonical representations of architecture so that
different architectural tool sets can be integrated
• ADL Integration
• Better system generation capabilities
• New and improved analysis capabilities
> reliability, performance, security
• Dynamism
> modeling, monitoring, constraining
• COTS-oriented styles and tools
• Views integration
• Better integration with other software
development tools/processes
• Rapide ADL
> pavg.stanford.edu/rapide/
• C2 Project at UC Irvine
> www.ics.uci.edu/pub/arch/
• Tutorial slides:
> www.cs.cmu.edu/~able/talks_online/icse99_tutorial