Microsoft IT and Microsoft Research released a Line Of Code (LOC) counter that counts the number of lines of code in your software development project to determine the size and status of your project, predicting system defects, providing measurements of productivity and quality, accessing code stability, and using these metrics to measure the success of your project.
LOC Counter can be used as a stand-alone client or as a Visual Studio 2005 add-in. The tool has the following features:
- It handles many different programming languages.
- It performs many different kinds of code counts.
- It handles comments, system-generated code, blank lines, and code churn.
- It connects to many different repositories.
- It provides an estimated defect density that is based on code churn.
- It is customizable. A user can change the kinds of objects that are counted during a counting task.
- It generates detailed reports. In addition, a user can export the report information to a Microsoft Office Excel® worksheet or to a Portable Document Format (PDF) file.
- It is fast. The tool can parse 10 million lines of code in less than one hour.
It uses a Defect Density Algorithm developed from Microsoft Research that uses the following version control history of a file to estimate the software defect density with an accuracy of 89 percent:
- The number of times that the selected files has been modified
- The time period in which the modifications have occurred
- The number of files that were actually modified
“Use of Relative Code Churn Measures to Predict System Defect Density” is a PDF document from Microsoft Research that describes this.
An IT Showcase web cast called How Microsoft IT Uses Visual Studio Team System 2005 to Measure Software Code Stability includes a discussion on how code changes, also known as code churn, may affect the code stability of a programming project.