Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Software Metrics are a measure of some property of a piece of software or its specifications.

A measure of some property of a piece of software or its specifications.

Basically, as applied to the software product, a software metric measures (or quantifies) a characteristic of the software. Some common software metrics (discussed later) are:-

  • Source lines of code.
  • Cyclomatic complexity, is used to measure code complexity.
  • Function point analysis (FPA), is used to measure the size (functions) of software.
  • Bugs per lines of code.
  • Code coverage, measures the code lines that are executed for a given set of software tests.
  • Cohesion, measures how well the source code in a given module work together to provide a single function.
  • Coupling, measures how well two software components are data related, i.e. how independent they are.

The above list is only a small set of software metrics, the important points to note are:-

  • They are all measurable, that is they can be quantified.
  • They are all related to one or more software quality characteristics.

The last point, related to software characteristics, is important for software process improvement. Metrics, for both process and software, tell us to what extent a desired characteristic is present in our processes or our software systems. Maintainability is a desired characteristic of a software component and is referenced in all the main software quality models (including the ISO 9126). One good measure of maintainability would be time required to fix a fault. This gives us a handle on maintainability but another measure that would relate more to the cause of poor maintainability would be code complexity. A method for measuring code complexity was developed by Thomas McCabe and with this method a quantitative assessment of any piece of code can be made. Code complexity can be specified and can be known by measurement, whereas time to repair can only be measured after the software is in support. Both time to repair and code complexity are software metrics and can both be applied to software process improvement.

This article is part of a series of articles on SQA metrics found at

history | excerpt history