19
Lucian Voinea Visualizing the Evolution of Code The Visual Code Navigator (VCN) Nunspeet, 24.11.2008

Lucian Voinea Visualizing the Evolution of Code The Visual Code Navigator (VCN) Nunspeet, 24.11.2008

Embed Size (px)

Citation preview

Page 1: Lucian Voinea Visualizing the Evolution of Code The Visual Code Navigator (VCN) Nunspeet, 24.11.2008

Lucian Voinea

Visualizing the Evolution of CodeThe Visual Code Navigator (VCN)

Nunspeet, 24.11.2008

Page 2: Lucian Voinea Visualizing the Evolution of Code The Visual Code Navigator (VCN) Nunspeet, 24.11.2008

The software maintenance challenge

Software maintenance costs

80% of TCO( total cost of ownership)=

Mostly spent on understanding software

Often caused by uninformed decisions

Page 3: Lucian Voinea Visualizing the Evolution of Code The Visual Code Navigator (VCN) Nunspeet, 24.11.2008

• What is software visualization?

• Code Evolution Visualization in VCNo Line of code levelo File level

• Conclusions

Outline

Page 4: Lucian Voinea Visualizing the Evolution of Code The Visual Code Navigator (VCN) Nunspeet, 24.11.2008

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”

Page 5: Lucian Voinea Visualizing the Evolution of Code The Visual Code Navigator (VCN) Nunspeet, 24.11.2008

Software visualization vs visual programming

visual programmingtool

software visualizationtool

SW engineer

the visual artifact space

the software

visualprogramming

programvisualization

is readby

creates

generates

is analyzed by

creates

is examined by

Page 6: Lucian Voinea Visualizing the Evolution of Code The Visual Code Navigator (VCN) Nunspeet, 24.11.2008

Software visualization pipeline

softwaredata

dataacquisition

internaldata

dataprocessing

datamapping

enricheddata

visualrepresentations

graphicsrendering

imagehumaninterpretation

software analysis

data visualization

Page 7: Lucian Voinea Visualizing the Evolution of Code The Visual Code Navigator (VCN) Nunspeet, 24.11.2008

Software visualization classifications

Matrix of techniques [Myers, 1990]

type of data

time aspect

Dynamic(behavior)

Static(structure)

Code Data Algorithm

VCN

few many

evolution

Page 8: Lucian Voinea Visualizing the Evolution of Code The Visual Code Navigator (VCN) Nunspeet, 24.11.2008

Visual Code Navigator (VCN)

a toolset that provides different, but strongly interconnected views on software source codeVCN

VCNdatabase

CVS

SVN

Data processing enginesSCM

Page 9: Lucian Voinea Visualizing the Evolution of Code The Visual Code Navigator (VCN) Nunspeet, 24.11.2008

Code evolution visualization

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

Dev

elo

per

sM

anag

emen

t

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- get context dependent code editing suggestions - discover the developer network

Benefits:- assess impact more accurately- better plan maintenance activities- reduce software understanding time- minimize error injection probability

Page 10: Lucian Voinea Visualizing the Evolution of Code The Visual Code Navigator (VCN) Nunspeet, 24.11.2008

Code evolution visualization in VCN

Line of code level File level

CVSscan CVSgrab

Page 11: Lucian Voinea Visualizing the Evolution of Code The Visual Code Navigator (VCN) Nunspeet, 24.11.2008

Evolution visualization at line level

Goal: Understand how did a file evolve.- What were the major refactorings, contributions- Who is in charge of a given piece of code

CVSscan

if self.bShowClusterColor:glBlendFunc(GL_ONE_MINUS_...glEnable(GL_BLEND)yPos = 0 bSwitch = Truefor i in lCushionMap:if bSwitch:

cushions.drawColorCl..else:cushions.drawColorClus…bSwitch = not bSwitchyPos = yPos + i

glDisable(GL_BLEND) #cushion clustersglBlendFunc(GL_ZERO,GL_... glEnable(GL_BLEND)yPos = 0 bSwitch = True

Timev1 v2 v3 v4 v5

Color - encodes a line metric

Deleted lines Lines to be

inserted

Constant line New lines Legend

Normal Layout

Discrete time (versions) Discrete time (versions)

Horizontal Layout

Page 12: Lucian Voinea Visualizing the Evolution of Code The Visual Code Navigator (VCN) Nunspeet, 24.11.2008

Color encodes authors Color encodes line contents

Time (version)

File line

Time (version)

File line

Evolution visualization at line level

CVSscan

Page 13: Lucian Voinea Visualizing the Evolution of Code The Visual Code Navigator (VCN) Nunspeet, 24.11.2008

Version 2Version 1 Version 3

File 2 Version 1 Version 2

File 3 Version 1 Version 2

File 1

Time

Project

Evolution visualization at file level

CVSgrab

Goal: Understand how did a project evolve.

Page 14: Lucian Voinea Visualizing the Evolution of Code The Visual Code Navigator (VCN) Nunspeet, 24.11.2008

Version 2Version 1 Version 3

File 2 Version 1 Version 2

File 3 Version 1 Version 2

File 1

Time

Project

Release IDSizeComplexitySearched word…

Release IDSizeComplexitySearched word…

Evolution visualization at file level

CVSgrab

Goal: Understand how did a project evolve.

Sorting and clustering operations

Page 15: Lucian Voinea Visualizing the Evolution of Code The Visual Code Navigator (VCN) Nunspeet, 24.11.2008

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)

Case: Shall we buy this software stack ?

Evolution visualization at file level

CVSgrab

Page 16: Lucian Voinea Visualizing the Evolution of Code The Visual Code Navigator (VCN) Nunspeet, 24.11.2008

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

Conclusion:

1. There are currently no large scale debugging activities performed2. The largest recent debugging activity was localized to one folder3. Changes in the identified folder do not propagate outside

Evolution visualization at file level

CVSgrab

Page 17: Lucian Voinea Visualizing the Evolution of Code The Visual Code Navigator (VCN) Nunspeet, 24.11.2008

Conclusion:

Well distributed knowledge

Risky distribution of knowledge

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

Evolution visualization at file level

CVSgrab

Page 18: Lucian Voinea Visualizing the Evolution of Code The Visual Code Navigator (VCN) Nunspeet, 24.11.2008

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)

Page 19: Lucian Voinea Visualizing the Evolution of Code The Visual Code Navigator (VCN) Nunspeet, 24.11.2008

Thank you for your attention !

[email protected]

http://www.win.tue.nl/~lvoinea/VCN.htmlhttp://www.win.tue.nl/vis/