Skip to content

Instantly share code, notes, and snippets.

@kerrizor
Last active August 29, 2015 14:21
Show Gist options
  • Save kerrizor/1127d8ac4bfc32afaa93 to your computer and use it in GitHub Desktop.
Save kerrizor/1127d8ac4bfc32afaa93 to your computer and use it in GitHub Desktop.

Many of the best resources on the actual data behind code metrics are in white papers, dry IBM and .NET "Developer Zone" journals, and in Java land. Here's a bunch of links from when I was putting together my code metrics talk I gave at Steel City a couple years ago.

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- Antoine de Saint-Exupery


OO Design Quality Metrics: An Analysis of Dependencies

http://www.objectmentor.com/resources/articles/oodmetrc.pdf

Oh, Uncle Bob.. you've already done everything cool, haven't you?

This paper describes a set of metrics that can be used to measure the quality of an object-oriented design in terms of the interdependence between the subsystems of that design. Designs which are highly interdependent tend to be rigid, unreusable and hard to maintain. Yet interdependence is necessary if the subsystems of the design are to collaborate. Thus, some forms of dependency must be desirable, and other forms must be undesirable. This paper proposes a design pattern in which all the dependencies are of the desirable form. Finally, this paper describes a set of metrics that measure the conformance of a design to the desirable pattern


How useful are code metrics?

http://www.artima.com/weblogs/viewpost.jsp?thread=157839


C2 XP Wiki

http://c2.com/cgi/wiki?WelcomeVisitors

OMG this is a gorram national treasure and its mysteries can be plumbed for days. Definitely one time where reading the comments is essential.


Getting Empirical about Refactoring

http://www.stickyminds.com/article/getting-empirical-about-refactoring

Michael Feather's article that inspired the Turbulence gem


Predicting Bugs from History

http://www.springer.com/cda/content/document/cda_downloaddocument/9783540764397-c1.pdf?SGWID=0-0-45-515407-p173780334


Uncovering Causal Relationships between Software Metrics and Bugs

http://homepages.dcc.ufmg.br/~mtov/pub/2012_csmr.pdf

This is probably the one you're really looking for.


McCabe's original article on his metric

http://books.google.ro/books?id=vtNWAAAAMAAJ&pg=PA3#v=onepage&q&f=false


Exploring the Relationship between Cohesion and Complexity

http://thescipub.com/PDF/jcssp.2005.137.144.pdf


http://www.slideshare.net/andreas.zeller/myths-in-software-engineering


IEEE Archive

http://www.computer.org/portal/web/tse

I'm not a member, but there's a lot of great research articles on bug density, complexity, cohesion, etc


Random good things

McCabe, Tom. 1976. "A Complexity Measure." IEEE Transactions on Software Engineering, SE-2, no. 4 (December): 308-20 Shen, Vincent Y., et al. 1985. "Identifying Error-Prone Software--An Empirical Study." IEEE Transactions on Software Engineering SE-11, no.4 (April): 317-24. Ward, William T. 1989. "Software Defect Prevention Using McCabe's Complexity Metric." Hewlett-Packard Journal, April, 64-68.


No Silver Bullet - Essence and Accident in Software Engineering

http://faculty.salisbury.edu/~xswang/Research/Papers/SERelated/no-silver-bullet.pdf or http://www.cs.nott.ac.uk/~cah/G51ISS/Documents/NoSilverBullet.html


Refactoring towards "better" code

http://blowmage.com/2013/03/07/refactoring-better-code

Mike walks through a refactoring, and shows a solid pattern of extraction, along with a great argument for it at the end:

Schizophrenic code, by which I mean methods with an inconsistent level of abstraction, is difficult to reason about. Programmers new to your app will struggle more than necessary in order to understand how the app works. I've seen this over and over, and the effect is similar to hazing new members of a group. Don't be a code bully, whether intentional or not. Life is too short to deal with hostile code. Be nice in all that you do, including your code.


Code Quality: Metrics That Matter

http://chriskottom.com/blog/2015/01/code-quality-metrics-that-matter/


Applying the ABC Metric to C, C++, and Java

http://www.softwarerenovation.com/ABCMetric.pdf

Great paper laying out the argument for Assignments, Branches, and Conditionals complexity metrics


Software Complexity and Maintenance Costs

http://www.pitt.edu/~ckemerer/CK%20research%20papers/SwComplexityAndMaintenanceCost_BankerDatar93.pdf


The Halstead metrics

http://www.virtualmachinery.com/sidebar2.htm

The website is janky as shit, but the info on Halstead's 1977 work on maintainability is great


In pursuit of code quality: Tame the chatterbox

Tools and metrics for measuring code verbosity

http://www.ibm.com/developerworks/java/library/j-cq06306/

Andrew Glover has a whole series of code quality articles (~20 or so) and they're all interesting reading.


http://qualilogy.com/en/category/application-quality/

For some reason, I kept coming back to a number of articles on this blog.


Maintainability index in Visual Studio

http://blogs.msdn.com/b/zainnab/archive/2011/05/26/code-metrics-maintainability-index.aspx


The Difficulty of Software Engineering

https://mperry.github.io/2012/07/26/software-engineering-is-hard.html


Comparative Study of Software Metrics

http://thesai.org/Downloads/Volume4No9/Paper_25-Comparative_Study_of_the_Software_Metrics.pdf


http://www.slideshare.net/sunilhbti/code-quality-32859072?related=1 slide 16 for maintainability index, also 17 for Halstead


http://static1.1.sqspcdn.com/static/f/702523/9456986/1290003183740/200108-Liso.pdf?token=wrpupMMllzAi1JTodL55bwRbe%2F8%3D


http://www.ecs.csun.edu/~rlingard/comp589/ColemanPaper.pdf


Ruby Rogues #41 http://devchat.tv/ruby-rogues/041-rr-code-metrics


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment