Software Architecture Recovery and Comprehension An Overview of State-of-the-Art Tools and DIVER Demonstration Software Architecture Recovery and Comprehension DIVER Demonstration Philippe Charland Software Analysis and Robustness February 23, 2011
Software Architecture Recovery and Comprehension
An Overview of State-of-the-Art Tools and DIVER Demonstration
Software Architecture Recovery and Comprehension
DIVER Demonstration
Philippe CharlandSoftware Analysis and Robustness
February 23, 2011
Outline
1. Software Architecture
a Erosiona. Erosion
b. Recovery
c Toolsc. Tools
2. DIVER Prototype
1
What is a Software Architecture?
• "The fundamental organization of a system embodied in its components, their relationships to each other, and the principles guiding its design and evolution "principles guiding its design and evolution.
- IEEE 1471 Standard
• If a project has not achieved a system architecture, including its rationale, the project should not proceed to full scale , p j pdevelopment […]
- Barry Boehm [Boehm '95]
2
Undocumented Software Architecture
• The original architecture was never recorded.
• The documentation has been lostThe documentation has been lost.
• The documentation is no longer synchronized with the system (i.e., architectural erosion):
– Abstractions are broken down.
– Layers are bridged.
– Information hiding is compromised.
3
Architectural Erosion
As-Is
Change in theEnvironment
Change in
Architecture
ArchitectureReconstruction
Environment
Ch i h Ch i
gthe Code
Code
Change in the Architecture
Change in the Code
Architecture
4
Architecture Recovery
• The "as-is" architecture of an implemented system is obtained from existing software artefacts.
• Done through a detailed analysis using static and dynamic tools support.
E t t d i f ti i d t b ild d t i• Extracted information is used to build and aggregate successive abstraction levels.
5
Architecture Recovery
• Interpretive, interactive, and iterative process.
• It is not automatic!It is not automatic!
• Requires the skills and attention of both a reverse engineer and architect.
6
Architecture Recovery
• Architectural constructs are not explicitly represented in the source code.
– No construct for "layer" or "connector"
• Architectural patterns are seldom labelled.
• Architectural constructs are realized by a collection:
– Functions
– Classes
– Files
– Objects
7
Architecture Recovery
• Why?
– Basis for architecture redocumentationBasis for architecture redocumentation
– Conformance of the "as-built "architecture vs. "as-designed"
– Starting point for re-engineering– Starting point for re-engineering
– Identify elements for re-use
Architectural risk analysis– Architectural risk analysis
– …
8
Modeling a Software Architecture
VocabularyFunctionality
System assemblyConfigurationmanagement
Design View Implementation View
g
Use Case View
Behaviour
Interaction View Deployment View
f lPerformanceScalabilityThroughput
System topologyDistributionDeliveryInstallation
Conceptual - Logical Physical - Operational
9
Conceptual - Logical Physical Operational
Supporting Tools
Tool Category Architectural Views
Unified Modeling Language (UML)• Design View
Unified Modeling Language (UML) • Interaction View
Dependency Structure Matrix (DSM) • Design View• Design View
VisualizationDesign View
• Implementation ViewMetrics • Design ViewProfilers • Interaction viewProfilers • Interaction view
10
UML Tools
Name Company DiagramsSupportedLanguages
E li UML O d Cl S JEclipseUML Omondo Class, Sequence Java
Enterprise Architect Sparx Systems Class, Sequence C++, C#, Java
MagicDraw No Magic Class, Sequence C++, C#, Java
Modelio Modeliosoft Class C++, C#, Java
Rational Rose Developer
IBM Class C++, Java
Together Borland Class, Sequence C++, Java
UModel Altova Class, Sequence C#, Java
Visual Paradigm SDE Visual Paradigm Class Sequence C++ JavaVisual Paradigm SDE Visual Paradigm Class, Sequence C++, Java
Visustin Aivosto Activity C, C++, C#, Java
11
SDE: Streamlined Design and Development Environment
DSM Tools
• Lattix LDM – Ada 83 and 95, C, C++, Java, .NET
– www lattix comwww.lattix.com
12
DSM: Dependency Structure MatrixLDM: Lattix Dependency Model
Lattix LDM
• Class A is said to depend on a Class B if:
– Class A inherits from Class BClass A inherits from Class B
– Class A calls a method or a constructor in Class B
– Class A refers to a data member in Class B– Class A refers to a data member in Class B
– Class A refers to Class B (e.g., as an argument in a method)
13
14
Other DSM Tools
• CppDepend – C++
– www cppdepend comwww.cppdepend.com
• NDepend – .NET
– www ndepend com– www.ndepend.com
• XDepend – Java
www xdepend com– www.xdepend.com
• IntelliJ IDEA – Java
j tb i /id– www.jetbrains.com/idea
15
Visualization Tools
• Headway Structure101 – C, C++, Java, .Net
– www headwaysoftware comwww.headwaysoftware.com
16
Dependency Management
17
Dependency Management
18
Dependency Management
19
Dependency Management
20
Dependency Matrix
21
Dependency Analysis
22
Dependency Analysis
23
Dependency Analysis
24
Auto-Partitioning Unstructured Code
25
Finding Unstructured ("Fat") Items
26
Impact Analysis
27
Impact Analysis
28
Understand Tangles (Package-Level Cycles)
29
Understand Tangles (Package-Level Cycles)
30
Show Structural Differences
31
Other Visualization Tools
• STAN – Java
– stan4j comstan4j.com
• Coverity Architecture Analysis – C, C++, Java
– www coverity com/products/architecture-analysis html– www.coverity.com/products/architecture-analysis.html
32
Defining an Architecture
33
Other Visualization Tools
• SonarJ – Java
– www hello2morrow com/products/sonarjwww.hello2morrow.com/products/sonarj
• Sotoarc – C, C++, C#, Java
– www hello2morrow com/products/sotoarc– www.hello2morrow.com/products/sotoarc
34
35
Other Visualization Tools
• Klocwork Insight – C, C++, C#, Java
– www klocwork com/products/insight/www.klocwork.com/products/insight/
• SolidSource Software eXplorer – C, C++, Java, .NET
– www solidsourceit com/products/SolidSX-source-code-– www.solidsourceit.com/products/SolidSX-source-code-dependency-analysis.html
36
37
Metrics
• Measure the code base
• Object-oriented package metrics:Object oriented package metrics:
– Abstractness
– Afferent Coupling (Ca)– Afferent Coupling (Ca)
– Efferent Coupling (Ce)
Analyzed Package
CeCa
38
Metrics Tools
• XDepend – Java
– www xdepend comwww.xdepend.com
• CppDepend – C++
– www cppdepend com– www.cppdepend.com
• NDepend – .NET
www ndepend com– www.ndepend.com
39
40
Tree Diagram and Treemap
b3
a16
3 d10
j1e1
k1
e1
b3 c3 d10
f2 g2 h4 i4 f2
c3
l1 m1 n1 o1
h4
j1 k1 l1 m1 n1 o1
l1 m1 n1 o1
41
Other Metrics Tools
• Scientific Toolworks Understand – C, C++, C#, Java
– www scitools com/products/understand/www.scitools.com/products/understand/
• SolidSource Software eXplorer – C, C++, Java, .NET
– www solidsourceit com/products/SolidSX-source-code-– www.solidsourceit.com/products/SolidSX-source-code-dependency-analysis.html
• SonarJ – Java
– www.hello2morrow.com/products/sonarj
• STAN – Java
– stan4j.com
42
Profilers
• Quest Software JProbe – Java
– www quest com/jprobewww.quest.com/jprobe
43
44
Other Profilers
• AQtime – C++, Java, .NET
– www automatedqa com/products/aqtimewww.automatedqa.com/products/aqtime
• EclEmma – Java
– www eclemma org– www.eclemma.org
• Cobertura – Java
cobertura sourceforge net– cobertura.sourceforge.net
– XDepend can infer metrics on the coverage data
NC NET• NCover – .NET
– www.ncover.com
45
– NDepend can infer metrics on the coverage data
DIVER: Dynamic Interactive Views For Reverse Engineering
• Generate execution-based sequence diagrams
• Support several navigation and simplification techniques:Support several navigation and simplification techniques:
– Method calls and objects grouping
– Breadcrumb trail– Breadcrumb trail
– Sequence diagrams comparison
• Open source application available at diver sourceforge net• Open source application available at diver.sourceforge.net
•
46
CHISEL: Computer Human Interaction Software Engineering Lab
DIVER Demonstration
47
Configuration Dialog
48
New Launch Configuration
49
New Launch Configuration
50
DIVER Perspective
51
Package Pane
52
Package Pane
53
Groups
54
Groups - Loops
55
Trace Outline View
56
Refocusing a Sequence Diagram
57
Refocusing a Sequence Diagram
58
Breadcrumb Trail
59
Timeline
60
Clone Pane
61
Clone Pane
62
Filtering the Package Explorer
63
Filtering the Package Explorer
64
Filtering a Sequence Diagram
65
Questions
66
67