Evaluation of code indicators

There has been considerable discussion about code metrics (for example: What is the passion for code metrics? ). I (as a software developer) are really interested in these metrics because I think they can help write better code. At the very least, they are useful when it comes to finding areas of code that need some refactoring.

However, I would like to know the following. Are there some estimates of these indicators of the source code that prove that they really correlate with the error or maintainability of the method. For example: do methods with very high cyclomatic complexity really create more errors than methods with low complexity? Or do methods with a high level of complexity (Halstead) really need much more to support them than methods with a low level?

Perhaps someone is aware of some reliable research in this area.

Thank you so much!

+6
code-metrics software-quality
source share
5 answers

Good question, direct answer.

There are research documents that show the relationship between, for example, cyclic complexity and errors. The problem is that most research is not available.

I found the following: http://www.pitt.edu/~ckemerer/CK%20research%20papers/CyclomaticComplexityDensity_GillKemerer91.pdf . Although this shows the connection between cyclic complexity and performance. However, it does have some links to other documents, and it’s worth a try with Google.

+2
source share

Check out this Microsoft research article . In general, I doubt the wisdom of development coming from Microsoft, but they have the resources to be able to do long-term research on large products. The mentioned article talks about the correlation found between various metrics and the level of project defects.

+1
source share

Finally, I found several articles on the correlation between software metrics and error rates, but none of them were really what I was looking for. Most articles are outdated (late 80s or early 90s).

I think it would be nice to start analyzing the current software. In my opinion, it should be possible to explore some open source population systems. The source code is available and (which, in my opinion, is much more important), many projects use trackers and a version control system. You could probably find a strong connection between the version control system magazine and the problem trackers. This would lead to a very interesting possibility of analyzing the relationship between some software metrics and the error rate.

Maybe there is another project that does exactly what I described above. Does anyone know about something like this?

+1
source share

We conducted an empirical study of the error prediction capabilities of the well-known object-oriented indicators Chidamber and Kemerer. It turned out that these combined indicators can predict errors with an accuracy of over 80% when we use the right machine learning models. If you are interested, you can prepare a full study in the following article:

β€œEmpirical Validation of Object Oriented Metrics in Open Source Software for Failure Prediction. In IEEE Software Development Transactions, Volume 31, No. 10, October 2005, pp. 897-910."

0
source share

All Articles