Vous êtes sur la page 1sur 19

Visualizing the Evolution of Code

The Visual Code Navigator (VCN)

Lucian Voinea

Nunspeet, 24.11.2008
The software maintenance challenge

Often caused by
uninformed decisions

=
Software 80% of TCO
maintenance costs ( total cost of ownership)

Mostly spent on
understanding software
Outline

• What is software visualization?

• Code Evolution Visualization in VCN


o Line of code level
o File level

• Conclusions
What is software visualization?

Scientific Visualization: “The use of computers or techniques for


comprehending data or to extract knowledge from the results of
simulations, computations, or measurements”
[McCormick et al, 1987]

Information Visualization: “Visualization applied to abstract quantities and


relations in order to get insight in the data”
[Chi, 2000][Diehl, 2006][…]

Software Visualization: “Information visualization applied to software


artefacts e.g. source code, design documents, profiling logs, and
dynamic data structures in order to better write, understand and
maintain, software”
Software visualization vs visual programming

the visual artifact space

is examined by software visualization


creates tool

is analyzed by

program
visualization the software
visual
SW engineer programming
generates

visual programming
creates is read tool
by
Software visualization pipeline

software analysis

software data internal data enriched


data acquisition data processing data

data
mapping

human image graphics visual


interpretation rendering representations
data visualization
Software visualization classifications

Matrix of techniques [Myers, 1990]

few many

time aspect

evolution

Dynamic
(behavior)

Static VCN
(structure)
type of data
Code Data Algorithm
Visual Code Navigator (VCN)

a toolset that provides different, but strongly


VCN interconnected views on software source code

VCN
database
CVS
SVN

SCM Data processing engines


Code evolution visualization

Goal: Understand when, why, and how software changed to cope with
future activities (e.g. refactoring, release scheduling, test planning etc.)

Use cases:
- identify the system parts that could be affected by a change or migration
- identify the system areas that are subject to debugging in the near future
Management

- get context dependent code editing suggestions


- discover the developer network

Benefits:
- assess impact more accurately
Developers

- better plan maintenance activities


- reduce software understanding time
- minimize error injection probability
Code evolution visualization in VCN

Line of code level File level

CVSscan CVSgrab
Evolution visualization at line level
CVSscan
Goal: Understand how did a file evolve.
- What were the major refactorings, contributions
- Who is in charge of a given piece of code
v1 v2 v3 v4 v5 Time
if self.bShowClusterColor:
glBlendFunc(GL_ONE_MINUS_...
glEnable(GL_BLEND)
yPos = 0
bSwitch = True
for i in lCushionMap:
if bSwitch:
cushions.drawColorCl..
else:
cushions.drawColorClus…
bSwitch = not bSwitch
yPos = yPos + i
glDisable(GL_BLEND)
#cushion clusters
glBlendFunc(GL_ZERO,GL_...
glEnable(GL_BLEND)
yPos = 0
bSwitch = True

Normal Layout Horizontal Layout


Color - encodes a
Discrete time (versions)
line metric Discrete time (versions)

Deleted
Lines to be lines
inserted

Legend Constant line New lines


Evolution visualization at line level
CVSscan
Time (version) Time (version)

Color encodes authors Color encodes line contents


File line File line
Evolution visualization at file level
CVSgrab
Goal: Understand how did a project evolve.

Project

File 3 Version 1 Version 2

File 2 Version 1 Version 2

Version 1 Version 2 Version 3


File 1

Time
Evolution visualization at file level
CVSgrab
Goal: Understand how did a project evolve.

Release ID
Size
Project
Complexity

Sorting and clustering operations


Searched word

File 3 Version 1 Version 2

File 2 Version 1 Version 2

Version 1 Version 2 Version 3


File 1

Time
Evolution visualization at file level
CVSgrab

Case: Shall we buy this software stack ?

Conclusion:

1. Software is not in a mature state (development is not stabilized).


2. It is difficult to maintain (high activity in large files).
3. Highly complex (≈ 30% have McCabe’s metric ≥ 7 per 30 lines of code)
Evolution visualization at file level
CVSgrab

Case: What is the risk of releasing the software now?

Conclusion:

1. There are currently no large scale debugging activities performed


2. The largest recent debugging activity was localized to one folder
3. Changes in the identified folder do not propagate outside
Evolution visualization at file level
CVSgrab

Case: What is the risk of one person leaving the team ?

Conclusion:
Well distributed knowledge

Risky distribution of knowledge


Conclusions

Software Visualization
• is a new but quickly growing field; many tools are emerging at a high pace
• promising but validation is still a problem; integration is a must!

Visual Code Navigator


• contains two tools for analyzing source code evolution (CVSscan, CVSgrab)
• offers a set of visual techniques that can supports a large variety of analysis
scenarios
• tries to bridge the gap between research and industry by tight integration with
common software configuration management (SCM) systems (e.g., CVS,
Subversion)
http://www.win.tue.nl/~lvoinea/VCN.html
http://www.win.tue.nl/vis/

Thank you for your attention !

lucian.voinea@solidsource.nl

Vous aimerez peut-être aussi