2. What are software metrics?
Quantitative measurements distilled from data
Distilled by measuring software development processes and
actual source code
Highlight areas that need work in specific nodes of code as
well as generalizations about your code overall
"You can't control what you can't measure" -Tom DeMarco
3. Limitations of metrics
Software metrics are intended to help programmers control and
monitor software production, but...
It's difficult to determine "how much" software there is in a given
program
Can give a skewed impression of software, especially when calculated
early in the software development process
Can be difficult or complex to calculate, especially as the volume of
code grows
4. Examples of metrics
Lines of code
Number of classes & interfaces
Code to comment ratio
Cyclomatic complexity
Code coverage
Bugs to lines of code ratio
Cohesion
Coupling
Failed tests per build
Version control commits per day
Lines of code per commit
5. Terminology
Node
A block of source code, usually either a single line, a function/method, class, or package. A
node can have multiple children, but only one direct parent
Program
A graph of all of the nodes that comprise the source code
Flow graph
A directed graph of all of the single line nodes connected with vertices where the possible
flow of execution might proceed
6. Some Specifics
Lines of Code
Code to comment ratio
Cyclomatic Complexity
Code Coverage
Cohesion
Coupling
Methods for decreasing coupling and increasing cohesion
Free tools for auditing software