Be sure to install .NET Framework 3.5, SQL Server Express and a command-line client for version control system of your choice (Subversion or Git). It is recommended to have a local copy of a repository for fast processing.

First of all you need a configuration file for you repository. It is a text file with settings for unity dependency injection container. Can take this one if your code is under Subversion and this one if your code is under Git. Open the configuration file for editing. Change database name in the connection string to your project name.

<param name=”connectionString”>
<value value=”Data Source=.\SQLEXPRESS;Integrated Security=true;Database=gnome-terminal;” />
</param>

Insert the path to your version control repository.

<param name=”repositoryPath”>
<value value=”file:///E:/repo/gnome-terminal/svn” />
</param>

The history of changes will be mapped from a repository to a database in simplified form. It is possible to select which files will be mapped. There are six filters for file mapping to skip/take path by extension, list and regular expression. If you want to map the entire repository – remove them all from list of path selectors.

<property name=”PathSelectors”>
<array>
</array>
</property>

You can input instead list of file extensions to select files from repository for instance.

<register type=”TakePathByExtension” mapTo=”TakePathByExtension” >
<property name=”Extensions”>
<array>
<value value=”.py” />
<value value=”.js” />

</array>
</property>
</register>

And don’t forget about list of path selectors.

<register type=”ProjectFileMapper” mapTo=”ProjectFileMapper” >
<property name=”PathSelectors”>
<array>
<dependency type=”TakePathByExtension” />
</array>
</property>
</register>

Identification of bugfix revisions is based on analysis of commit log message. You can replace default keywords with something else if your commit messages is not in english for instance.

<register type=”IBugFixDetector” mapTo=”BugFixDetectorBasedOnLogMessage” >
<property name=”KeyWords”>
<array>
<value value=”fix” />
<value value=”bug” />
<value value=”bugfix” />
</array>
</property>
<property name=”StopWords”>
<value value=”typo” />
</property>
</register>

Save the configuration file with name of your project in MSR Tools directory. Now you are ready for mapping. Let’s run mapping for the first ten revisions.

MSR.Tools.Mapper.exe MyProject.config map -c -n 10

Use option “-c” for first time mapping to create data base and schema. Also this option allows to recreate data base and remove all data. After that you can use mapping incrementally. Now you can run mapping for another ten revisions.

MSR.Tools.Mapper.exe MyProject.config map -n 20

It is possible to use a revision number or a revision itself in command.

MSR.Tools.Mapper.exe MyProject.config map -c -r 20

For Git you should use the entire revision hash.

When you have data base it is time to get something more interesting. You can get statistics.

MSR.Tools.StatGenerator.exe MyProject.config stat

Also you can get some plots with Visualizer or some predictions with Predictor. Run MSR.Tools.Visualizer.exe or MSR.Tools.Predictor.exe and open from menu your configuration file. For more details about configuration schema see this manual.

Comments are closed.