Software testing methodology using cyclomatic complexity metric


















Survey of source code metrics for evaluating testability of object oriented systems. View 3 excerpts, cites background. An extension to the cyclomatic measure of program complexity. Structured testing: analysis and extensions. Cyclomatic Complexity and the Year IEEE Softw. Art of Software Testing. IEEE Trans. Software Eng. A Complexity Measure. The growth of software testing. View 1 excerpt, cites methods.

Structured testing: analysis and extensions. Predicting class testability using object-oriented metrics.

View 2 excerpts, cites methods and background. A decompiler for Objective-C. View 1 excerpt, cites background. Testing is a vital component of software engineering. As complex programs become integrated into all aspects of society, it is important that there exist no errors that could compromise safety, … Expand. One of the major aspect to analyze a software system under the testing process is the path testing.

The path testing can be defined either a white box or the black box testing approach. Notice the cyclomatic complexity is at 2 the lowest value possible. When you change the if statement to a switch statement with 4 decisions to be made then, it goes from the original 2 to By itself, this may not be a big deal, but given that most other members have a 1 in the same class, you should definitely look closer at those two items and see what is in them.

You can do this by right-clicking the item and choosing Go To Source Code from the context menu. Take a closer look at Product. Given all the if statements, you can see why the cyclomatic complexity is at a 5. At this point, you may decide that this is an acceptable level of complexity, or you might refactor to reduce the complexity. As with many metrics in this industry, there is no exact cyclomatic complexity limit that fits all organizations.

However, NIST does indicate that a limit of 10 is a good starting point:. The original limit of 10 as proposed by McCabe has significant supporting evidence, but limits as high as 15 have been used successfully as well. Limits over 10 should be reserved for projects that have several operational advantages over typical projects, for example experienced staff, formal design, a modern programming language, structured programming, code walkthroughs, and a comprehensive test plan.

The number of tests required for a software module is equal to the cyclomatic complexity of that module. The original structured testing document [NBS99] discusses cyclomatic complexity and the basic testing technique. This document gives an expanded and updated presentation of those topics, describes several new complexity measures and testing strategies, and presents the experience gained through the practical application of these techniques.

The software complexity measures described in this document are: cyclomatic complexity, module design complexity, integration complexity, object integration complexity, actual complexity, realizable complexity, essential complexity, and data complexity. The testing techniques are described for module testing, integration testing, and object-oriented testing.

A significant amount of practical advice is given concerning the application of these techniques. The use of complexity measurement to manage software reliability and maintainability is discussed, along with strategies to control complexity during maintenance.



0コメント

  • 1000 / 1000