Weitere ähnliche Inhalte Ähnlich wie Understanding your code assets with Moose (20) Kürzlich hochgeladen (20) Understanding your code assets with Moose1. 8/18/05 © Tudor Gîrba
Understanding your code assets
with Moose
Stéphane Ducasse, Tudor Gîrba, Adrian Kuhn
Software Composition Group
University of Bern, Switzerland
Michele Lanza
Faculty of Informatics
University of Lugano, Switzerland
…
2. 8/18/05 © Tudor Gîrba
2
Context: Software development is more than
forward engineering
Requirements
Analysis
Design
ImplementationTime
3. 8/18/05 © Tudor Gîrba
3
Reverse engineering is creating high level views
of the system …
For example:
It provides an overview, by
striping away details
4. 8/18/05 © Tudor Gîrba
4
Reverse engineering is creating high level views
of the system …
Large systems
Not an algorithm
Multiple techniques:
UML diagrams
Metrics
Visualization
…
5. 8/18/05 © Tudor Gîrba
5
Moose is a reengineering tool which integrates
multiple techniques
Visualization
Evolution Analysis
Moose
…
Queries and Navigation
Number of classes = 382
Number of methods = 4268
…
Semantic Analysis
Metrics
word1 word2
6. 8/18/05 © Tudor Gîrba
6
…
= 7Average number of
methods per class
= 4268Number of methods
= 382Number of classes
Metrics compress the system into numbers and
enable comparisons
Metrics can answer questions:
How big is the system?
How is the complexity spread over the system?
…
7. 8/18/05 © Tudor Gîrba
7
Visualization compresses the system into
pictures
Visualization can provide:
Quick overview
Spatial orientation
…
8. 8/18/05 © Tudor Gîrba
8
Visualization: Polymetric views can display up to
5 metrics on a 2D figure
Color
Metric
Position
Metrics
Width Metric
Height
Metric System
Complexity View
Class Blueprint
9. 8/18/05 © Tudor Gîrba
9
Queries reduce the analysis space
Queries reveal:
Similar entities
Entities which are out of ordinary
Queries make use of properties (e.g., metrics)
10. 8/18/05 © Tudor Gîrba
10
Moose at work: analyzing the structure of
software systems
Visualization
Queries and Navigation
Number of classes = 382
Number of methods = 4268
…
Metrics
11. 8/18/05 © Tudor Gîrba
11
Semantic analysis attaches semantics to
structure
word1
word3
word2
…
Applicability:
Text Search
Semantic Clustering
…
12. 8/18/05 © Tudor Gîrba
12
Moose at work: analyzing the semantics of
software systems
Semantic Analysis
word1 word2
13. 8/18/05 © Tudor Gîrba
13
Time contains useful information for reverse
engineering
Time
Requirements
Analysis
Design
Implementation
14. 8/18/05 © Tudor Gîrba
14
The evolution analysis compresses time through
metrics, visualization …
History can answer questions:
Which parts are change-prone?
How did the system get in the current shape?
…
Problem: Large amounts of data
15. 8/18/05 © Tudor Gîrba
15
Our approach: History as a first class entity
encapsulates the evolution
Vers.1 Vers.2 Vers.3 Vers.4 Vers.5
History
A
B
C
D
16. 8/18/05 © Tudor Gîrba
16
History can be measured: How much was a class
changed in its history?
4 2 3 31
3 + 2 + 1 + 0
Evolution of Number
of Methods (E_NOM)
Stability of Number
of Methods (S_NOM)
0 + 0 + 0 + 1
4
=
= = 0.25
= 6
17. 8/18/05 © Tudor Gîrba
17
Moose at work: analyzing the history of software
systems
Evolution Analysis
18. 8/18/05 © Tudor Gîrba
18
…
Actually, Moose is an environment for
reengineering
Van
VW Smalltalk
Java
C/C++ Parser
Cobol
Tools integration
mechanisms
Metrics
Language independent
model repository
CodeCrawler
Visualization
Evolution
analysis
…
Semantic analysis
Concept analysis
Dynamic analysis
Clustering
Duplication detection
…
19. 8/18/05 © Tudor Gîrba
19
Class
Namespace
Method
Attribute
InvocationAccess
Inheritance
Package…
1
*
*
*
*
1
*
2
*21*
1
*
1*
Moose is language independent through the
FAMIX meta-model
Java Parser: jFamix Eclipse Plugin (http://jfamix.sourceforge.net/)
C++ Parser: Columbus (http://www.frontendart.com/products.html#Columbus)
Java/C++ Parser: iPlasma (Loose Research Group)
20. 8/18/05 © Tudor Gîrba
20
Moose has been validated on real life systems
written in different languages
…………
~1800260’000SmalltalkSqueak
~4900300’000JavaJBoss
~700135’000SmalltalkJun
~110001’000’000C/C++X
~400120’000C++/JavaY
~23001’200’000C++Z
ClassesLines of CodeLanguageSystem
21. 8/18/05 © Tudor Gîrba
21
Summary: Moose is an extensible and
collaborative reengineering environment
is research driven: metrics, visualization,
evolution analysis …
is industrially validated
is free under BSD license
Accessibility:
www.iam.unibe.ch/~scg/Research/Moose/
VisualWorks distribution CD
Questions?
22. 8/18/05 © Tudor Gîrba
22
Ownership Map reveals how developers drive
software evolution