Metrics how-to

How to get started with software metrics? Here are a few practical ways to use metrics to accomplish everyday tasks.

How to get a quick start?

When you need a quick start to the metrics on your code, get the Project status report.

How to measure coding productivity?

Save metrics at certain time intervals, such as once a month. Alternatively, analyze historical versions of a project.

Open the project in the "Project in time" tab. Choose Change/day in the combobox at the top.

Use the metric LLOC/day to evaluate how many real lines of code were added per day. Remember that this metric doesn't take comments, whitespace or modified/deleted code into account.

Choose Metric values in the combobox at the top. Verify that the metric DEAD has not increased significantly. This metric tells the relative amount of dead code. If it has increased dramatically, a lot of the new lines of code may actually be dead. If it has decreased, the developers have spent their time removing dead code, which is a good sign and explains why LLOC/day could be low.

Besides DEAD, the value of dLINES is also worth looking at. This is the number of lines in dead procedures.

How to verify that the code is properly commented?

Open one of the project-level tabs. See the latest value of MCOMM%. This value tells the number of real comments per lines of real code. A value of 20% tells that for each 5 code lines there is one real comment.

You can find the files that need more comments in the File tab. Again, look at the MCOMM% column to find which files have too few comments.

How to convince the boss?

Take the Project status report.

How to find procedures that require extensive testing?

We assume that a procedure that executes complex code or a procedure that is heavily used by other procedures is likely to require more testing.

Open the Procedures tab. Find the columns LLOC, LLOCt, IC1, CC and SFIN. Click on each of these columns to sort the data in ascending or descending order. View the procedures having the largest values in these columns. These are the procedures that should be tested more than the others.

How to find procedures that might benefit from optimization?

Open the Procedures tab. Find the columns LLOC, PARAMS, DLOOP and SFIN. Click on each of these columns to sort the data in ascending or descending order. View the procedures having the largest values in these columns. These are the procedures where optimization efforts could be more beneficial than elsewhere.

How to find incomprehensible code?

Open the Procedures tab. Find the columns LLOC, PARAMS, CC, DCOND, IFIO, IC1 and SYSC and SFIN. Click on each of these columns to sort the data in ascending or descending order. View the procedures having the largest values in these columns. These are the procedures that are likely to be harder to understand than the others. You may need to split or rewrite some of the procedures. You might also do by adding comments to procedures whose MCOMM is low.

How to find exceptionally bad (or good) code?

Select the metric you wish to use by moving the cursor on its column. Sort the data by clicking on the column header. Look for outlier values. Outliers are values that are higher or lower than most other values in the data set. Thus, the code may be exceptional in some sense. You can view the outlier limits at the bottom of the main window. Values below or above the shown limit(s) are considered outliers. Repeat this for the metrics you want to use to detect all outliers which could be problematic code.

How to compare teams?

Suppose two teams are working on two projects. You can use Project Metrics from time to time to compare their status. Pick the Latest analyses tab and view the following metrics:

How to evaluate work done last month?

Suppose you want to perform a monthly evaluation of your project. You can accomplish this by storing metrics at fixed intervals (say, on the 1st day of each month) and taking a look at the Project in time tab of Project Metrics.

How to collect metrics?

Standardize the collection of metrics. When your metrics process is standardized, you can monitor how the metrics develop in time and how your projects compare to each other.

How to add speed to Project Metrics Viewer?

If you are experiencing slow performance with Project Metrics Viewer, limit the amount of data shown:

© Project Analyzer Help