BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Using Complexity Measurements to Improve Software Quality

Using Complexity Measurements to Improve Software Quality

This item in japanese

Bookmarks

Complexity measurements can be used to estimate development and test activities and to decide where refactoring is needed to improve quality and prevent problems. At the QA&Test 2014 conference Shashi Katiyar from Intel presented about effective use of complexity metrics for software quality improvement.

Complexity is a measure of the interactions of various elements of the software. According to Shashi software complexity is a direct indicator of software quality and costs: if the complexity for any code is high, the quality of that code will be lower and it will cost more to manage it.

Shashi stated the issues organizations are facing when their software product are having complex code:

  • Higher risk of defects
  • Difficult to add new functionality
  • Difficult to understand/maintain the code
  • Difficult to validate

You can measure complexity for instance wit McCabe Cyclomatic Complexity. This measurement provides the numbers of linearly independent paths in the code which is an indication of the testing difficulty and reliability of the software. It can be used in estimating development and maintenance effort.

Based on the complexity data you know the minimum number of test cases that is needed to cover all paths. The complexity data helps you to:

  • Concentrate on the complex modules
  • Find out the most effective testing technique
  • Know when to stop the testing
  • Increase the Testability of the software 

You can achieve more predictability in managing software systems as Shashi explained:

Before working on any software product, if one knows that it is a complex module, some extra time may be assigned during the estimation. Knowing the complexity beforehand help the project team to estimate it better to pay attention during development and testing to make sure that quality of the product is not compromised.

At Intel data was collected from complexity measurements and on the amount of changes in a module. The complexity data was combined with bugs that were reported by customers. When a module was complex and had been changed many times due to defects, the decision was taken to refactor it. Before refactoring they ensured that there were test cases covering the code. This way of working increased the ROI of refactoring.

Shashi talked about the challenges he sees in software development related to complexity and quality:

In the highly competitive & dynamic environment, companies are trying to differentiate it services by providing more features to its users. It is resulting in substantial growth in line of code and complexity, which is a big challenge. If proper prevention are not taken to manage the complexity of the product, very quickly these products turn into unmanageable products. Lots of companies are still using old code and old technology because over the time, they got their systems so complex that moving them to new technologies becoming an extremely difficult task.

“In the highly competitive environment, it is very important to be innovative and develop high quality software” said Shashi. “Organizations can set targets to reduce the complexity of all high complex programs which are changed more frequently to improve the quality of their software”.

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

  • Any company is practicing this?

    by Chen Andy,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    It would be helpful to see how the complexity measurement being applied to real software testing practices. Any examples?

  • Re: Any company is practicing this?

    by Shashi Katiyar,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    We are using this method in our company to reduce the complexity of the most complex functions but in cases where it is not possible to reduce the complexity of any functions, we work with validation team to make sure that they cover all the paths of these functions during validation.

  • Re: Any company is practicing this?

    by Mariusz Sieraczkiewicz,

    Your message is awaiting moderation. Thank you for participating in the discussion.

    The Feather's Quadrant can help to extract places really worth investing time in refactoring and improving quality. Some hints you can be found here www.infoq.com/articles/natural-course-refactoring

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT