LearnViz CompSci
Home / Learn / Software Engineering / Software Metrics

Advanced Topic 41 of 50 Software Engineering

Software Metrics

Measurements of size, complexity and quality.

How it works

Software metrics quantify properties of code, process and product. Code metrics include lines of code, cyclomatic complexity, coupling, cohesion, test coverage and duplication. Process metrics include velocity, cycle time, lead time, deployment frequency, change failure rate and mean time to recovery, the DORA measures. Product metrics track defects, performance, reliability and user satisfaction. Metrics should support decisions, not just be collected.

Step-by-step walkthrough

  1. Metrics turn qualities into numbers.
  2. Lines of code estimate size.
  3. Cyclomatic complexity counts decision paths.
  4. Coverage shows how much code tests execute.
  5. Defect rate tracks quality, but measure to learn, not to rank people.

Where it is used

Teams use dashboards and static analysis to spot risky code, track delivery health, set quality gates in CI and justify improvements.

Common pitfall

Goodhart's law applies: when a measure becomes a target, it stops being a good measure. Counting lines of code or commits to judge productivity is misleading, and 100 percent coverage does not prove quality. Metrics without context mislead. Choose a few meaningful ones, watch trends rather than single values and combine them with qualitative review.

Where it fits in the course

Software Metrics is topic 41 of 50 in Software Engineering, rated Advanced. It follows GraphQL. The next topic is Cyclomatic Complexity.

Practice and explore

How to study this topic

  1. Read the explanation above and restate the definition in your own words.
  2. Open the interactive lesson and answer its mini quiz.
  3. Read the common pitfall, then write a short example that avoids it.
  4. Check your understanding in the Software Engineering quiz, and revisit the topic if you miss a question.

Frequently asked questions

What is Software Metrics?
Measurements of size, complexity and quality. It belongs to Software Engineering and is an advanced-level topic.
Where do people use Software Metrics?
Teams use dashboards and static analysis to spot risky code, track delivery health, set quality gates in CI and justify improvements.
What is the most common mistake with Software Metrics?
Goodhart's law applies: when a measure becomes a target, it stops being a good measure.
What should I learn before this topic?
Start with GraphQL, the topic just before it in Software Engineering.
How can I practice it?
Answer the mini quiz in the interactive lesson, then take the Software Engineering quiz.
Is Software Metrics hard to learn?
It is an Advanced topic. Expect to read the explanation more than once and to connect it with earlier topics. Working through a small example by hand helps most.
How long does it take to learn Software Metrics?
Most learners can read the explanation and finish the interactive lesson in under an hour. Fluency comes from applying the idea, so plan a few short practice sessions with the quiz.
Which topics are related to Software Metrics?
GraphQL, Cyclomatic Complexity, REST are closely connected. The full list is in the related topics section of this page.
What should I study after Software Metrics?
Continue with Cyclomatic Complexity, the next topic in Software Engineering.

Related topics