Professional Documents
Culture Documents
Architecture
Architecture Recovery?
We frequently need to reason architecturally
about existing systems.
We need to be able to:
analyze architectures
(re)document architectures
identify architectural dependencies
Architecture Conformance?
Question: If my architecture was designed
with a particular property in mind, does the
property hold for my target system?
(Probable) Answer: Who knows?
Why Conformance?
Architectures are frequently undocumented
or documentation is not current.
The architecture of the implemented system
must conform to the architectural design.
Otherwise, architectural drift and erosion are
inevitable.
But conformance (by hand) is a dreary task.
Momentary Philosophical Break
What is software architecture?
Answer: Maybe . . .
What Is This?
And this?
Architecture as Mass Delusion
Question: What is a layer?
Answers:
At worst a delusion.
At best a convention.
Nothing that exists in what we actually build (e.g.
no layer construct in a programming language).
Nothing that is enforceable.
And Yet . . .
Architectures use these abstractions
regularly.
Architects think and plan and analyze in
terms of these abstractions.
So
we should support these abstractions and
connect them to what we do build.
So What Is Architecture Recovery?
A process in which hypotheses are generated
and tested
These hypotheses are ideally the inverse of
the mappings developed during design
The reconstructor must add information
during the reconstruction process
This depends on the reconstructors available
information and bias
Reconstruction Process
Source Code,
Documentation
Source Model,
Fusion Selected Architecture Views
Architecture View
Reconstruction
Composition
Architectural Views,
Styles, Patterns, Drivers
View Extraction
Apply whatever tools are available or
appropriate for a given target system:
parsers (Imagix, SNiFF+, CIA, rigiparse,
Understand)
AST-based analyzers (Gen++, Refine)
lexical analyzers (LSME)
profilers (gprof)
code instrumentation
ad hoc (grep, perl)
Static Views Alone are Insufficient
Much architecture-related information may be
extracted statically from source code,
compile-time artifacts and design artifacts.
Examples:
identify types
aggregate local variables with functions
aggregate members with classes
compose architecture-level elements
Example: VANISH
White noise:
a typical source
model.
Apply Generic Patterns
Aggregate
functions and
local variables;
classes and
members; classes
and files.
Apply Application-Specific Patterns
Hide utilities.
The Final Product
As designed: As implemented:
Dialogue Dialogue
BAD GOOD
Evaluation - The View
Perform analyses.
Dialogue Application
Presentation
Example 2
IPC
Example 3
File
access
Instrumentation
If information (such as file accesses, IPC) is
not available through an extractor, we
instrument the code.
e.g. for this example we instrumented:
all calls to fopen
all IPC calls
Guidelines for Reconstruction
Obtain a high-level view of the architecture
before starting reconstruction:
helps to identify what to look for
helps to identify what source information to extract
(what information is architecturally relevant?)