Any tools to get code churn metrics for a Subversion repository?

Adam picture Adam · Sep 10, 2008 · Viewed 12.1k times · Source

I'm looking for any tools that can give you code churn metrics (graphs and charts would be even better) for a Subversion repository.

One tool I know of is statsvn - a Java tool that creates some HTML reports and some code churn metrics. Statsvn reports the number of lines modified (churned) by user over time, some descriptive stats on LOC per file and folder/subfolder, etc.

I would like to know code churn in order to get a better idea of the state of the project. Idea behind this inspired by the MS research: Use of Relative Code Churn Measures to Predict System Defect Density

In a nutshell, the more that source code is churning (changing, whether adding new lines, deleting, changing,etc) the higher the probability that defects are being introduced into the system. The MS research paper says that the number of defects produced can be predicted based on a number of relative code churn measures.

I wanted to know if there are any others that are maybe open source, extensible, etc.

Answer

Nitin Bhide picture Nitin Bhide · Feb 14, 2009

I have written a tool called 'svnplot' (which I admit was inspired by the output of StatSVN). Its written in python and available on Google code. http://code.google.com/p/svnplot. You can see the sample output at http://thinkingcraftsman.in/projects/svnplot/index.htm

The details/output are not as elaborate as 'fisheye'. Basically it converts the Subversion log history into a 'sqlite' database and then queries sqlite database to generate graphs. You can write your own queries using the created sqlite database.

See if it works for you.