Software quality: To the rescue!

Improving code quality

In this post we’ll show what a healthy relationship with code quality looks like. After our introductory post, software quality (‘SQ’ for friends) might seem intimidating, maybe even daunting. But fear not, SQ is here to help, let’s see how.

Code quality is your friend

In general terms, SQ can help in a daily development activity:

  • Check that you’re OK (or rather, your code)
  • Help you quickly see mistakes or oversights
  • Boost your experience by learning better practices

This translates into:

  • Write beautiful code: not too complex, enough comments, no clones, minimal risks
    • Better Reliability and Safety
  • Write better code, which can be read and understood even months later, and conform to good patterns
    • Increased Maintainability and Performance

And once you have code quality as your ally, you can use it to ask questions:

  • In the present: “Does the code I just wrote comply with the principles I chose to follow?”
  • Looking back in the past: “What errors do I keep making (not necessarily at the same location)?”
  • Anticipating the future: “My code seems to get more complex. Is it getting out of hand?”

This is all well and good, but what does it mean in practice?

Well, trusted answers come from knowledgeable and reliable sources. In our case, it means we need a way to extract knowledge from the source code, in a consistent way.

Source Code analysis should extract Code attributes in a repeatable and deterministic way
Code quality starts with a reliable analysis

You are code quality’s friend

We’ll explore soon how quality can be measured to produce attributes to work on, but for now, let’s just keep it simple:

“Benefits of SQ come with trust in its results”

And as good relationships are built on balance, SQ also needs to rely on you!

It doesn’t have to be a big commitment, we’re talking about:

  • Defining the practices and checks best suited for the project and the team
    It’s a matter of listing what you already agree on and apply when coding.
  • Tailoring SQ to focus on relevant findings
    With the previous list, SQ can help detect deviations from your practices.
  • Gently produce results
    It is frustrating and discouraging to parse 20 pages of rule violations.
    SQ can help focus on issues found on freshly written code, critical code, cloned code or a combination of these.
  • Build a habit
    As well-known checks and manageable issues lists become familiar, we incorporate them into our personal process.
    We no longer “do” quality, we “are” quality.
  • Quality by design
    As SQ has its place in our development toolbox, we can use it to keep being good, and aim at getting better.

In essence, software quality should not be a sudden act of self-awareness leading to disruptive decisions, but a smooth progression.

We are not binary creatures (despite our current subject), and usually dislike forced change. But there is one thing we can be very good at: evolution.

And so, we can indeed experience a healthy relationship with code quality, if we are given the proper messages. In the following posts, we’ll look into how SQ can translate its quantitative results into meaningful qualitative assessments.

Further readings

Share:

Legal Notice

This text is the intellectual property of the author and is copyrighted by coderskitchen.com. You are welcome to reuse the thoughts from this blog post. However, the author must always be mentioned with a link to this post!

Leave a Comment

Related Posts

Int code overflow - coderskitchen
John Paliotta

Why is everything an int?

In C/C++ applications, most scalar variables are defined as ‘int’.  Do these applications deal with lots of large numbers that need 32-bit integers?  Not likely,

Flavien Huynh

Measuring and monitoring technical debt

The technical debt concept has been around for some time now. We can find it in international conferences, in scientific articles, books, and even here

Software quality - origin story - Coderskitchen
Flavien Huynh

Software quality: Origin story

Software quality is a vast field, which has been the subject of many studies, standards and tools for a long time (if we think in