Software

Software Quality Attributes

The attributes in the article are technical capabilities that should be used in order to fulfill the non-functional requirements, so the most important and common quality attributes are:

  1. Scalability.
  2. Manageability.
  3. Modularity.
  4. Extensibility.
  5. Testability.

In reality there are much more quality attributes: wikipedia.

Intro illities.png

Scalability

Adding computing resources without any interruption.

Non-Scalable System, which obviously require a lot of efforts to fix it:

  1. Look for non-scalable code.
  2. Rewrite non-scalable code.
  3. Reinforce VM.

Scalable System:

  1. Add VM.
  2. Notify the Load Balancer.

There are 2 types of scalability: scale up (vertical) and scale out (horizontal).

ScaleUpScaleDown.png

The preferable option is Scale Out which has 2 main benefits:

  1. Redundancy – more VMs, more changes the system continue to work even if some of the server crashed.
  2. No Limits – can add more CPU and memory. It’s cheaper to have many average servers than 1 super powerful. Load balancer must be in place for the Scale Out approach, which require stateless architecture pattern.

Previously I dedicated about scalability a part of the article about good code: https://ivanbrygar.com/2020/07/24/good-code-in-short/

MANAGEABILITY

Know what’s going on and take actions accordingly.

Manageability.png

How to know if the system manageable? Just answer on 1 question, who reports problems: users or system itself reports problems?

Modularity

A system that is built from building blocks, that can be changed or replaced without affecting the whole system.

Let’s say we have the next architecture where our system consumes external API and do simple job as get and save the data to DB.

Modularity.png
Not modular system.

The our system work and do the needed job. But what if the External API system should be replaced with a new one? Then as a result our system will be affected as a whole application which requires full redeployment and hence full testing. To resolve this issue we should make the application as modular, so the code for the “Get the data” is encapsulated in a small independent component.

ModularityApplied.png
Modular system.

As a result we have, if the external system will be changed, then only the specific component should be changed, leaving the rest of the system intact. Now the system is more flexible and maintainable that makes deployment faster and safer.

EXTENSIBILITY

A system that its functionality can be extended without modifying its existing code.

Let’s imagine the next scenario. The system support XML and JSON output format.

ExtensibilityBefore.png
Original requirements.

The new requirements saying that a new format must be supported as well.

ExtensibilityAfter.png
New requirements to support CSV format.

If the original code has something like this at the backend, then the system has a serious problem and doesn’t support extensibility because requires code modification to adding a new case, therefore requires to run all the tests in order to ensure that nothing was broken:

switch (format) {
    case "xml":
        return formatXml(data);
    case "json":
        return formatJson(data);
}

To solve the issue there are many approaches, but the most common is to use DI and factory method (GetFormatter in our case) where no need to modify the original code but rather to extend it:

string formatQuery(string format, string data)
{
    IFormatter formatter = GetFormatter(format);
    
    return formatter.Format(data);
}

The factory method returns implementation of IFormatter interface.

TESTABILITY

How easy it to test the application?

The testable system that is easy to test using: unit testing and integration testing.

Testability’s characteristics:

  1. Independent modules and methods.
  2. Single responsibility.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.