reconstructing an architecture

Post on 11-Jan-2016

31 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Reconstructing an Architecture. Why. Lost documentation No documentation ever Architectural drift Prove conformance. Approaches. Manual Methods Top down For example, start with high-level diagrams Bottom up For example, start with comments in code Opportunistic - PowerPoint PPT Presentation

TRANSCRIPT

Reconstructing an Architecture

Why

Lost documentationNo documentation everArchitectural driftProve conformance

Approaches

Manual Methods Top down

For example, start with high-level diagrams Bottom up

For example, start with comments in code Opportunistic

Use whatever is available

Tools

Tool-Based Reconstruction

View Extraction

DB

Presentation

Pattern Recogn.

Visualization

View Fusion

Reconstruction

Doc

System

Data Source Types

StaticDynamic

Tools

ParsersAbstract Syntax Tree AnalyzersLexical AnalyzerProfilersCode instrumentation toolsAd hocWorkbench

Extracted Data

<includes file file><contains file function><defines_var file variable><contains directory directory><contains directory file><calls function function><access_read function variable><access_write function variable>

Guidelines

Use least-effortValidate the information extractedExtract dynamic information when needed For example, if the system uses a lot

of late binding or runtime configuration

Tool-Based Reconstruction

View Extraction

DB

Presentation

Pattern Recogn.

Visualization

View Fusion

Reconstruction

Doc

System

Database Structure

Need a standard format or model Authors use Rigi Standard Format RDF triples are very similar, and OWL

reasoning might be useful

Efficient queriesSupport fusion Checkpointing for intermediate results

DB tables

Table of relation namesTable of elementsTable for each relation - triples

RelationTable

RelationType Thing1 Thing2

IncludesTable

File1 File2

ContainsTable

File Function

And/Or

Tool-Based Reconstruction

View Extraction

DB

Presentation

Pattern Recogn.

Visualization

View Fusion

Reconstruction

Doc

System

View Fusion

ReconcileAugmentEstablish connections

Example: fusing static and dynamic views of the “calls” relation

Static: calls extracted from source List::length PrimitiveOp::Compute

Dynamic: calls detected by profiler List::length List::getnth ArithmeticOp::Compute StringOp::Compute

Static analyzer missed this (no reason given)

What about these?

Fusing static+dynamic, continued

PrimitiveOp

+Compute

ArithmeticOp

+Compute

StringOp

+Compute

Static analyzer saw this

Profiler saw these

List::lengthList::getnthPrimitiveOp::Compute

Fused list of calls:See examples 10-4, 10-5p 240

Example: fusing calls from different processes

main() { register();}

Server

main() { launch();}

GUI Launcher

Calls

main register

main launch

Calls

Server.main register

Launcher.main launch

Unfused Fused

Guidelines for Fusions

Fuse when no single view shows needed informationFuse when a view is too ambiguous and ambiguity can be resolved by fusionUse multiple extraction techniques Different kinds of tools Different implementations of tools

Tool-Based Reconstruction

View Extraction

DB

Presentation

Pattern Recogn.

Visualization

View Fusion

Reconstruction

Doc

System

Reconstructions

SQL examples for ReconstructionsSee 10.9 – aggregate local variables

Build SQL queries for reconstruction

Yet more guidelines

Work with the architect if possibleCode segments should be as re-usable as possible A “code segment” is a capability based on

DB query + other code, that can identify patterns or create views

Code segments can take advantage of Naming conventions Directory structure

Example in text

Repeated view fusions and aggregations eventually produce a just-barely-usable viewpp 248 – 257

top related