Source Code Visualization Plug-in

Extensions and customization
User avatar
pbittner
Gephi Plugin Developer
Posts:35
Joined:18 Mar 2010 23:03
Location:London, UK
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Source Code Visualization Plug-in

Post by pbittner » 13 Jun 2010 12:54

As part of my master's thesis, I am creating a source code visualization plug-in for Gephi. It will allow users to create a dependency graph of a local project or a project downloaded from a version control system, to generate software metrics (through static analysis and profiling), and to visualize the results with Gephi. If everything goes as planned, it will also be possible to visualize the evolution of the software project using the revisions available on a repository. Open-source applications will be used to generate the dependency graph and the software metrics (DependencyFinder, PMD, hprof...).

If you have got any suggestion or idea, let me know :)

admin
Gephi Community Manager
Posts:964
Joined:09 Dec 2009 14:41
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Source Code Visualization Plug-in

Post by admin » 13 Jun 2010 18:21

Hi,

I love this idea! I made some experiments when I was in engineering school with Gephi 0.6 and an Eclipse plug-in. Let's take a look at this! http://gephi.org/codeminer/

The source code is available here, but is not documented, sorry.

I know two other projects modeling source code as complex networks:
Gource
SolidSX

And someone working on Software Evolution at the Open University:
http://michel.wermelinger.ws/chezmichel ... e-quality/
http://michel.wermelinger.ws/chezmichel ... f-eclipse/

User avatar
pbittner
Gephi Plugin Developer
Posts:35
Joined:18 Mar 2010 23:03
Location:London, UK
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Source Code Visualization Plug-in

Post by pbittner » 14 Jun 2010 20:50

Thanks a lot for the information!

I had heard of codeminer but not of Gource and SolidSX. If I have the time, I'll add the possibility to generate a graph showing the relationships between developers and the files they have worked on (as in Gource). I had not thought of that before, it looks pretty interesting.

User avatar
mbastian
Gephi Architect
Posts:728
Joined:10 Dec 2009 10:11
Location:San Francisco, CA
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Source Code Visualization Plug-in

Post by mbastian » 15 Jun 2010 14:16

That is really a nice project you are starting, please keep us informed about it!

How would you generate the dependency graph? of which languages?

Come also to the IRC channel time to time ;)

User avatar
pbittner
Gephi Plugin Developer
Posts:35
Joined:18 Mar 2010 23:03
Location:London, UK
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Source Code Visualization Plug-in

Post by pbittner » 16 Jun 2010 01:20

I plan to use the Dependency Finder tool to generate the dependency graph from jar files. At first the plugin will only be able to work with java projects. I will extend it later to other languages if it is successful.

I'll let you know how it's working out :-)

User avatar
jbilcke
Gephi Core Developer
Posts:41
Joined:10 Dec 2009 17:48
Location:Paris, France
Contact:

Re: Source Code Visualization Plug-in

Post by jbilcke » 09 Jul 2010 17:48

Hi,
just came across this : http://www.cond.org/icse2007-final.pdf

it talks about "analysis of evolutionary code-clone behavior in software systems" (and also about a modification of Guess for visualization of these software systems, so this could lead to interesting ideas for the Gephi plugin as well)

User avatar
pbittner
Gephi Plugin Developer
Posts:35
Joined:18 Mar 2010 23:03
Location:London, UK
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Source Code Visualization Plug-in

Post by pbittner » 09 Jul 2010 17:53

Thank you very much, it seems to be an interesting paper! I'm going to read it right away.

User avatar
pbittner
Gephi Plugin Developer
Posts:35
Joined:18 Mar 2010 23:03
Location:London, UK
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Source Code Visualization Plug-in

Post by pbittner » 24 Jul 2010 15:05

The implementation of the plugin is now well advanced and I can update you a little bit about it.

I have attached three graphs obtained using the plugin. The first one is the dependency graph of the Gephi DHNSGraph package where the node color represents the length of the method associated (Non Commenting Source Statements metric). The dependency graph was obtained using the Dependency Finder tool (http://depfind.sourceforge.net/) and the NCSS metric using the JavaNCSS tool (http://javancss.codehaus.org/). The second graph is a call graph of jEdit (text editor) that shows the performance evolution of one package between the last two versions of the software. In green you have the nodes for which the performance (total relative time) has improved and in red the ones for which it has decreased. The Jip Profiler tool (http://jiprof.sourceforge.net/) was used to extract the call graph from each version and the graphs were compared. Finally, the last graph shows the dependency graph obtained from the same two versions of jEdit where you have in gray the methods that were not changed, in green the methods for which the number of lines was reduced and in red the methods that had their length increased.

All the tools used are command-line tools that are executed directly from the Gephi Plugin. They generate a txt or xml file that is automatically parsed to create a graph representation of the results. It is then possible to update a graph with the attributes of another graph and compare two graphs by creating a comparison graph (containing the absolute and relative change values of each numerical attribute). It will soon also be possible to merge graphs together. I implemented a simplified graph data structure to perform those operations but I think that it would be interesting to be able to do that kind of operations for any Gephi graph (comparison, update...). It would also be interesting to allow users to split the graph window in two and represent the same graph on each side (same spatialization) but with the node size and color representing a different attribute.

As I had to implement the plugin quickly for my master's thesis, it is not ready to be released but I hope that I will be able to do it by the end of August. I also plan to add more tools to the plugin (NetBeans Profiler snapshots support, Vtune, gprof...) when I have some time along with the possibility to create collaboration graphs from revision control systems.

Let me know what you think :)

Image

Image

Image

User avatar
mbastian
Gephi Architect
Posts:728
Joined:10 Dec 2009 10:11
Location:San Francisco, CA
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Source Code Visualization Plug-in

Post by mbastian » 25 Jul 2010 19:57

This is very interesting project, thank you for sharing this information. The graphs your plugins generates are in many ways useful for developers and architect. It is so much easier to share with someone how your system works if you have a map. Besides simple exploration, comparison and monitoring come also with tons of interesting uses-cases I guess...
I implemented a simplified graph data structure to perform those operations but I think that it would be interesting to be able to do that kind of operations for any Gephi graph (comparison, update...).
Ok, I would be interested to see what features you added to see if this could be generalized. Graph API and AttributesAPI allow already lots of things so it should be doable.
It would also be interesting to allow users to split the graph window in two and represent the same graph on each side (same spatialization) but with the node size and color representing a different attribute.
Yes that is nice idea, and could be reused in other context. I think the easiest way to do this is actually to improve workspace support. It should be possible to duplicate and merge workspaces easily. A compare feature would merge two workspaces and put one graph left and one graph right.
As I had to implement the plugin quickly for my master's thesis, it is not ready to be released but I hope that I will be able to do it by the end of August. I also plan to add more tools to the plugin (NetBeans Profiler snapshots support, Vtune, gprof...) when I have some time along with the possibility to create collaboration graphs from revision control systems.
I looked at the code and you did a nice design! Nicely splitting your modules and thinking modular. I was however not able to run it, it freezed when I launched a dependency import.

User avatar
pbittner
Gephi Plugin Developer
Posts:35
Joined:18 Mar 2010 23:03
Location:London, UK
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Source Code Visualization Plug-in

Post by pbittner » 27 Jul 2010 18:03

It is normal that you were not able to run dependency finder. Until yesterday I had not figured out how to run the jar files (of the command-line tools) included into the plugin. Thus you had to install each tool manually at a specific location (I was basically the only one who could use the plugin :roll:). It is not necessary anymore as I copy at runtime the necessary jar files from the plugin to a temporary directory so that they can be run from the command-line.

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable