Code Quality vs. Software Quality

Yesterday on Twitter, in a discussion about quality, the phrase “code quality” was used when I think the writer really meant “software quality.” In my view these are different things, with code quality being a subset of software quality.

Let’s explore and use an analogy. We’re going to relate software to building a house.

Centre St. Lofts 4-8-06 #2Code Quality is just that… Code

Code quality is just that: quality of the code. Here we’re looking at whether or not the code was written in a way that’s robust and maintainable. Thinking about code quality, we look at factors such as:

  • Did the developer use data structures that make sense?
  • Are things named in a reasonable fashion?
  • Are there comments explaining unclear or potentially confusing sections of code?

In short… is the code good?

To use the housing analogy, here we’re talking about the materials construction quality. For example:

  • Were the right materials used to build the house?
  • Is the work up to, um, code?
  • Are the joints solid, or are nails sticking out willy-nilly?

Software Quality is Wholistic

Let’s contrast this with software quality. Software is the system and how it works, which isn’t purely about how it was built. When we talk software quality, I look at the bigger picture. For example:

  • Does the software solve the user’s domain problem/needs?
  • Will the software adapt in the future to expected changes for the user?
  • Is the code quality such that the software will be able to be maintained in a reasonable fashion by resources that are available and affordable?

And in our housing analogy:

  • Does the house keep out the elements without leaking, given the climate for its location?
  • Is the house big enough for the residents? A house being built for a family of 12 probably needs more than one bathroom…
  • Was the house built and constructed such that maintenance or remodeling can be done using resources that are available and affordable?

See where we’re going here?

Code Quality Affects Software Quality

As noted, code quality affects software quality. Poor code quality is a contributing factor to poor software quality, much like shoddy construction is going to lead to an unfortunate housing situation. Poor code quality, like poor building quality, might not be evident immediately to the end user or housing occupant.

Poor code quality, or poor housing construction, often is a longer-term issue. Perhaps a new developer joins the team and is unable to easily understand or update some code because it was originally written in a sloppy fashion. Maybe the homeowner decides to remodel, only to discover that a wall was unexpectedly load-bearing. What if wiring shortcuts lead to an electrical fire?

With software, it seems that code quality ought to be a standard owned by the developers, while the overall software quality is a shared responsibility among the entire team including developers, analysts, and the product owner.

photo by Marshall Astor, used under Creative Commons license


Chime in with your thoughts

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s