How to Evaluate and Improve Your Production Code Quality

Posted by afranchimon • Jul 23, 2020 • 5 Minute Read

Experienced developers or tech professionals would be shocked to learn statistics about the existing quality of code. One document claims an estimated 100 billion lines of production code worldwide, 80% of which is unstructured, patched and poorly documented. Even if you can admit you’ve written some poor coding in your career as a developer, the number is still shockingly high.

The maintainability of code equals the quality of code. If the code is unstructured or patched, it follows that it is difficult to maintain. This is a bold conclusion, and something that puts software developers in a poor light.

Poor code quality is not limited to geographical boundaries, either. Any region of the world could be responsible for poor production code quality.

Let’s define software quality as one or all of the following:

  • Functional software quality combines the low defect rates with high levels of user satisfaction while meeting all the requirements
  • Structural software quality is exhibited through a robust architecture and well-structured code; source code with low complexity
  • Aesthetic software quality is measured through aesthetically pleasing with elegant and easy to use interfaces

Realistically, the most important of these is delivering great user experience. Producing engaging software that solves the user’s problem in an elegant fashion and gives the user the idea that he is in full control is the goal of every team. It is, however, not that easy.

What all these definitions have in common is that the software needs to be reliable, available and, most importantly, free of bugs.

Why code quality matters

Source code quality is the foundation of quality software. The number of defects is directly related to the quality of the code (Software quality in 2012). It has also been proven that good quality results are proportional to the success rate of the software project.

More than 90% of the projects with high quality are successful, while only 25% of the projects with poor quality can be defined as successful. On top of that, low-quality code is more expensive to maintain in the long run and will surpass the cost of a high-quality project at the end of the coding phase. High code quality will contribute to the sense of collective ownership.

How to end up in the 20%

In order to find out which group you fall in – poorly written versus well-written code – you need to start measuring. 

Software metrics generally receive negative criticism because people view them as an exact science. A popular argument against monitoring metrics is to write code for performance rather than maintainability. Unless you are writing a high-throughput real-time system where timing is mission-critical, choose maintainability over performance. 

Adding an extra computing instance in the cloud is cheaper on a monthly basis than an hour of development time in many parts of the world. Various studies on developers have pointed out that between 20 to 80 percent of the time of a developer is spent understanding other people’s code. You do the math.

Monitoring software metrics is not the Holy Grail by any means.

However, a basic chore like monitoring the metrics of your production code quality and keeping them up to par can greatly reduce your cost of maintenance. It can increase the chance of success for your software project and increase the shelf life of your software. 

Keeping an eye on your metrics also reduces risk: you and your business won’t be dependent on that one rock-star developer that only knows the intrinsic details of your hard-to-maintain system.

For maximum return on your investment, consider working with a team of experienced software developers instead. Let us handle the technical details while you focus on your results.

Whether you just came up with a new product idea or you’re already laying the groundwork, we’d love to hear about your next project.

Note: This post was originally published by Alain F. at