Let op! Internet Explorer wordt niet meer ondersteund. Hierdoor kan de website mogelijk niet goed functioneren, gebruik een alternatieve browser om optimaal gebruik te maken van deze website. Klik hier om een alternatieve browser te downloaden.

How to objectively measure code quality

On selecting metrics, models and maturity levels for objective code quality measurements

Author:

Author Laurens Jansen

Laurens Jansen

Customer Success Manager Follow Laurens Jansen on LinkedIn

The Importance of Measuring Code Quality

Measuring code quality is important for every organization that develops software. Why? Because something can only be improved if it is measured in an objective and repeatable way!

Major software defects in the field, like the Crowdstrike outage of 2024, have put code quality on the agenda of upper-management. Most organizations now understand that simply rushing through software deliveries without the proper precautions to ensure high code quality lead to trouble down the line. Whether that be unmaintainable code which makes adding even a small new feature take months, or software just straight out crashing in the field.

Now that the ‘why’ is clear, let’s focus on the ‘how’.

Core Metrics for Code Quality

Many different code metrics can be used to assess code quality. Some of them are very simple, like code duplication, and others are very complex, like abstract interpretation and deep flow analysis. In general, it is best to select metrics that will allow you to assess your code’s reliability, maintainability and security (as defined by the ISO 25010). If you score high on these metrics you sleep soundly knowing your code quality is high.

Models for measurement

When you have selected all your code quality metrics you can aggregate their results into an overarching model. This is important because a model allows for prioritization, focus and (most importantly) measuring progress.

At TIOBE, we have tried to combine reliability, maintainability and security into one model: the TIOBE Quality Indicator. We use this model to measure the code quality of 8.000+ projects of our customers on a daily basis. Two organizations can use different tools to measure their metrics, but because most mainstream tools have been mapped on the TQI model, they can still compare results.

Discover our TiCS Framework

An example of a Quality Model: the TIOBE Quality Indicator

Step-by-step guide

At TIOBE we have developed a step-by-step guide on how to improve your company’s code quality maturity. The steps are as follows:

  1. Do an ad-hoc quality measurement
  2. Implement continuous monitoring
  3. Involve end-users
  4. Set quality gates
  5. Set company standards
  6. Achieve full company quality

We dive deeper into these steps in our 6-steps guide for code quality maturity.

Conclusion

Once you start measuring code quality, the ways you can improve it become way more clear and tangible. Selecting the right metrics and quality model is very important. If you are interested in finding out how your software code ranks on our independent model, and want to benchmark against 8.000+ other projects, apply for our free, on-prem proof-of-concept!

Get free advice from our experts on measuring your code quality!

Reach out to our experts