On selecting metrics, models and maturity levels for objective code quality measurements
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’.
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.
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.
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:
We dive deeper into these steps in our 6-steps guide for code quality maturity.
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