Title: Modeling and Analysis of Architectural Exceptions
1Modeling and Analysis ofArchitectural
Exceptions
- Fernando Castor Filho Patrick Henrique da
S. Brito - fernando_at_ic.unicamp.br
patrick.silva_at_ic.unicamp.br - Cecília Mary F. Rubira
- cmrubira_at_ic.unicamp.br
- FM2005 Workshop on Rigorous Engineering of
Fault-Tolerant Systems - REFT2005, Newcastle upon Tyne, July 19th 2005
2Exception Handling
- Popular mechanism for structuring forward error
recovery in software systems - Exceptions can be derived incrementally at
different phases of development - Requirements
- Architecture
- Detailed Design
- Implementation
3Exception Handling
- Popular mechanism for structuring forward error
recovery in software systems - Exceptions can be derived incrementally at
different phases of development - Requirements
- Architecture
- Detailed Design
- Implementation
4Exceptions at the Architectural Level
- A systems exceptional activity should be
addressed since the early phases of development - In recent years, many approaches combining
software architecture and exception handling have
been proposed - There hasnt been much focus on the description
of exceptions at the architectural level - This may be required for systems with strict
dependability requirements such as commercial
applications, control systems, and so on.
5An Air-Traffic Control System Example
Exceptions
Exceptions
Exceptions
Exceptions
Exceptions
Exceptions
Source Bass, Clements, and Kazman,
Software Architecture in Practice, 2nd Edition,
2003.
6... Some Interesting questions...
- What does a double-headed arrow mean?
- What are the exceptions that each component
signals and handles? - Are there any relevant cause-effect
relationships? - Is this analyzable?
7Problem
- To describe software architectures so that it is
possible to reason about the flow of exceptions
at the architectural level
8Requirements of the Solution
- Easy to use (pictorial representation)
- Integrated with the concept of architectural
style - Precise (unambiguous)
- Analyzable
- Capable of expressing rules of existing exception
handling models
9Alloy Design Language
- Lightweight formal method
- Similar to Z (less expressive but supports
automated analysis) - Support for complex data structures
- Declarative
- Alloy constraint analyzer
- Easy to use
- Requirements 3-5
10Proposed Framework Aereal
Normal Architectural Styles
Exceptional Architectural Styles
Architecture Description Extended with Exceptions
Translation
Arch. Description Exception Flow View
11Proposed Framework Aereal
Normal Architectural Styles
Exceptional Architectural Styles
Architecture Description Extended with Exceptions
Translation
Arch. Description Exception Flow View
- Documentation
- Analysis of stylistic constraints
12Proposed Framework Aereal
Normal Architectural Styles
Exceptional Architectural Styles
Architecture Description Extended with Exceptions
Translation
Arch. Description Exception Flow View
13Proposed Framework Aereal
Normal Architectural Styles
ACME
Exceptional Architectural Styles
Architecture Description Extended with Exceptions
Translation
Arch. Description Exception Flow View
Alloy
14Elements of the Model
Components Signals Raises Encounters Handles SignalsTo CatchesFrom PortMap Ducts Signals Raises Encounters CatchesFrom SignalsTo Exceptions
15An Example
CoalFeederController
Duct1
AirFlowController
16An Example
GENERIC MODEL sig Component Signals Exception-gtDuct, SignalsTo set Duct, sig Duct Encounters set Exception, CatchesFrom one Component INSTANTIATION sig AirFlowCtr extends Component sig Duct1 extends Duct sig AirFlowActuatorTimeout extends Exception fact SystemStructure AirFlowCtr.SignalsTo Duct1 Duct1.CatchesFrom AirFlowCtr fact ExceptionFlow AirFlowCtr.Signals AirFlowActuatorTimeout-gtDuct1 Duct1.Encounters AirFlowActuatorTimeout
17Properties of Interest
- Basic EH mechanism properties
- Desirable EH properties
- Application-specific properties
- Verified using the Alloy Analyzer
- Violations of properties generate graphical
counter-examples
18Examples of Properties
- Exceptions encountered by a component and not
handled or propagated are signaled - If a component raises an exception, it must also
signal the exception - The exceptions encountered by a component are all
the exceptions signaled by ducts in the
components CatchesFrom set - No useless handlers
19Example No useless handlers
- pred no_useless_handlers()
- all C Component all D C.CatchesFrom
- D.(C.Handles) in D.(C.Encounters)
-
- D.(C.Encounters)lt(D.(C.Propagates))D.(C.Prop
agates) -
20Future Directions
- Model coordinated exception handling
- Technical report describing the whole model
- Extend the implementation of Aereal in order to
automatically compute the sets of exceptions that
are caught and signaled
21Thank You!
Contact information Fernando Castor
Filho fernando_at_ic.unicamp.br fernando.castor_at_newca
stle.ac.uk