Software metrics

from Wikipedia, the free encyclopedia

A software metric , or metric for short , is a (mostly mathematical) function that maps a property of software into a numerical value, also called a measure . This creates formal comparison and evaluation options.


Formally, one speaks of applying the metric to a software unit . The result is the measure. In the majority of cases, the software unit refers to the underlying source code . Since the source code is usually distributed to one or more individual files, the metric can be applied to all or parts of the source code, depending on the type. There are also metrics, such as function point analysis , that can already be applied to the specification of software in order to determine the effort required to develop the software in advance.

In the form of a numerical value, the measure, the metric serves as a measure for a property, a quality feature, of software. It can represent a functional context or it can be derived from a checklist. Simple metrics show the size of the source code in lines or characters, more complex metrics try to assess the comprehensibility of the source code. A suitable number of different metrics can be used to assess how complex (i.e. labor-intensive and cost-intensive) the maintenance, further development and subsequent tests of the software will be.

A newly developed program often not only requires certain functions, but also quality features such as maintainability, expandability or comprehensibility. Software metrics cannot evaluate the correct implementation of the functions; they can at best determine in advance how much effort the creation of the software will cause and how many errors will occur.

If metrics are used regularly during the long-term further development of a software, negative trends, i.e. deviations from the quality target, can be discovered and corrected at an early stage.

The interpretation of the data of a software metric is the task of the discipline of software metrics , there the software metrics represent part of the basic data for the interpretation.

Definition according to IEEE Standard 1061

software quality metric: A function whose inputs are software data and whose output is a single numerical value that can be interpreted as the degree to which software possesses a given attribute that affects its quality.

"A software quality metric is a function that maps a software unit into a numerical value, which can be interpreted as the degree of fulfillment of a quality property of the software unit."

- IEEE Standard 1061, 1998

Order of software metrics

Metrics serve different aspects of the emerging software, the applied process model and the evaluation of the fulfillment of the requirements.


The use of metrics extends from the assessment of the development phases to the assessment of the phase results to the assessment of the technologies used. The aim of using a metric in software development is the error prognosis and the cost estimate, whereby a distinction is made between preceding, concurrent and retrospective use.


Basically, metrics that remain manageable are one-dimensional. In doing so, they force simplification. Typically this is achieved by narrowing down each metric to one point of view. This then necessarily means that other views are not served at the same time with the same quality.

  1. Management perspective
  2. Developer's point of view
    • Readability (maintenance, reuse)
    • Efficiency and effectiveness
    • Trust ( residual errors , MTBF , tests)
  3. Point of view of the customer
    • Estimates (adherence to budget, adherence to deadlines)
    • Quality (reliability, correctness)
    • Return on investment (maintainability, expandability)


For the different aspects of the assessment there are design metrics , economic metrics , communication metrics , etc. Metrics can be assigned to different classes that identify the subject of the measurement or assessment:

  1. Process metric
    • Resource expenditure (employees, time, costs)
    • error
    • Communication effort
  2. Product metric
  3. Effort metric
    • Effort stability
    • Distribution of effort
    • productivity
    • Effort-deadline loyalty
  4. Project duration metric
    • Development time
    • Average development time
    • Milestone trend analysis
    • On-time delivery
  5. Complexity Metric
    • Software size
    • Degree of completion
  6. Application metric
    • Training effort
    • Customer satisfaction

Quality criteria

A metric from the software production phase alone is not a quality criterion. As a rule, quality features are measured against the fulfillment of the customer's requirements and their application. The transferability of the results and the representation of the measured values ​​are important for the customer benefit:

  • Objectivity : no subjective influences of the measuring person
  • Reliability : same results if repeated
  • Standardization : measurement results scale and comparability scale
  • Comparability : dimensions can be related to other dimensions
  • Economy : minimal costs
  • Usefulness : measurable fulfillment of practical needs
  • Validity : inferring other parameters from measurable quantities (difficult)


Some of the more popular metrics are:

By combining existing metrics, new metrics are constantly being developed, some of which reflect new developments in software engineering . One example of this is the CRAP (Change Risk Analysis and Predictions) metric introduced in 2007 for assessing the maintainability of code.

In order to evaluate the level of information security in systems and infrastructures, security must be measured. Safety figures serve as objective, quantifiable measures in order to be able to make safety decisions both during the acquisition phase and during operation. One goal of security metrics is to prove that the planned and implemented security measures meet a specific security policy. This makes decisions and assessments with regard to IT security transparent and comprehensible. Areas of application for security metrics are the assessment of the security situation, security management or cyber insurance .

Selection of suitable metrics

The Goal Question Metric (GQM) method can be used to identify suitable metrics .

Software measurement and evaluation

Software measurement and evaluation describes a discipline in the field of computer science that deals with the systematic measurement and evaluation of various properties of software products, processes and projects.


  1. Phase and role model set
  2. Determine goals
  3. Define metric mask
  4. Draw up a measurement plan
  5. Collect data
  6. Validate data
  7. Analyze and interpret data
  8. Save and visualize data


Web links

Individual evidence

  1. ^ Institute of Electrical and Electronics Engineers (Ed.): IEEE Std 1061-1998. IEEE Standard for a Software Quality Metrics Methodology . IEEE, New York 1998, ISBN 1-55937-529-9 , Chapter 2. Definitions , pp. 2 .
  2. Fraunhofer FOKUS Competence Center Public IT: The ÖFIT trend sonar of IT security - security metrics. April 2016, accessed May 30, 2016 .