# Software Design Complexity - Software Engineering

## What is Software Design Complexity?

The events and the objects whose structures are build in a highly complicated way and which include multiple links that are interconnected is known as complexity. With respect to software programming, when a program has enormous interconnections and there are large number of elements, making the program difficult to understand is considered as software design complexity.

Different complexity metrics and measures are used without which the assessment of complexity of the software design is next to impossible. The complexity measures provided by the Software engineering are of three types. They are -

The metrics for software complexity measurement was invented by Mr. Maurice Howard Halstead, are known as Halstead’s complexity measures. Halstead’s metrics are related to the program implementation. The operator computes the metrics. The source codes of C/C++/Java are evaluated on the aspects of errors, testing time, size, vocabulary etc.

In the words of Halstead, the operators or the operands combine together and constitute tokens and a collection of such tokens constitute an algorithm and implementation of such an algorithm is defined as a computer program.

The complexity of the module is verified and clarified by using different indicators. They are -

 Parameter Meaning n1 Number of unique operators n2 Number of unique operands N1 Number of total occurrence of operators N2 Number of total occurrence of operands

When metric Viewer is used for checking the complexity details, the Metrics reports displays the results as follows -

 Metric Meaning Mathematical Representation n Vocabulary n1 + n2 N Size N1 + N2 V Volume Length * Log2 Vocabulary D Difficulty (n1/2) * (N1/n2) E Efforts Difficulty * Volume B Errors Volume / 3000 T Testing time Time = Efforts / S, where S=18 seconds.

## Cyclomatic Complexity Measures

Decisions regarding the statements that have to execute and tasks that are to be performed constitute a program. The flow of the program can be altered by these constructs of decision-making.

It is understood that the program which has more number of decision-making statements is more complex to understand as there is no stability on the control over the program.

The complexity of software can be quantified by Cyclomatic complexity measures. Some of the program constructs, that are used for decision making like if-else, do-while, repeat-until, switch-case and goto statements, a model is represented graphically.

Such graphs can be prepared by following the process -

• As directed by the constructs of decision-making, the program is divided into small programs.
• Nodes are to be created.
• Nodes are connected as follows:
1. If control can branch from block i to block j

Draw an arc

1. From exit node to entry node

Draw an arc.

The formula used for calculating the Cyclomatic complexity of a program is - The Cyclomatic complexity of the above module is

It is to be noted that, cyclomatic complexity of any program should not go beyond 10.

## Function Point

Function point facilitates in quantifying and measuring the software size by focusing on the system functions. For measurement of the complexity of the software, the functions and features of that particular software form the base of measurement.

There are five different parameters of a function point which are depicted below. Each of these parameters is classified into either simple or average or complex on the basis of each, software complexity is measured. The different parameters of the function point are -

### External Input

The inputs that come from outside to a particular system are external inputs. Each of these inputs is unique in nature. Data or the control parameters constitute the external inputs for the system. External input is considered -

• Simple - if input count is low and affects less internal files
• Complex - if input count is high and affects more internal files
• Average - in-between simple and complex.

### External Output

The outputs that are derived from a particular system are external outputs. Each of the outputs is unique in nature on the aspect of the format and their processing. External output is considered -

• Simple - if output count is low
• Complex - if output count is high
• Average - in between simple and complex.

### Logical Internal Files

The information of the system is preserved in the internal files thus enabling smooth functioning of the system. The logical data (functional and control) pertaining to the system are preserved in these internal files. Logical internal files can be -

• Simple - if number of record types are low
• Complex - if number of record types are high
• Average - in between simple and complex.

### External Interface Files

The files of a particular software system are shared by other software. Some of the files are required for system functions processing. Such files are considered as external interface files.

Software system may need to share its files with some external software or it may need to pass the file for processing or as parameter to some function. All these files are counted as external interface files. External interface files can be -

• Simple - if number of record types in shared file are low
• Complex - if number of record types in shared file are high
• Average - in between simple and complex.

### External Inquiry

Data is sent by the user as an input which needs to be inquired and processed and the processed inquiry is sent by the system to the user as output. When the format and data of the input and output are unique, such a query is considered to be unique. External inquiry might be -

• Simple - if query needs low processing and yields small amount of output data
• Complex - if query needs high process and yields large amount of output data
• Average - in between simple and complex.

On the basis of class and complexity the system parameters are assigned weightages, which are tabulated below -

 Parameter Simple Average Complex Inputs 3 4 6 Outputs 4 5 7 Enquiry 3 4 6 Files 7 10 15 Interfaces 5 7 10

The Function points are provided by the table. Considering the complexity environment, the function points are changed. A number of characteristics are used for defining a system. They are -

• Data communications
• Distributed processing
• Performance objectives
• Transaction rate
• Online data entry,
• End user efficiency
• Online update
• Complex processing logic
• Re-usability
• Installation ease
• Operational ease
• Multiple sites
• Desire to facilitate changes

On the ratings of 0 to 5, each of these characteristics are rated.

• No influence
• Incidental
• Moderate
• Average
• Significant
• Essential

The ratings are collected and added together. The sum of all the ratings is considered as N. Here range of N is calculated as -

14 types of characteristics x 5 types of ratings

That comes to 70 and hence the range of N varies from 0 to 70.

The complexity Adjustment Factor (CAF) is calculated as -

Then,

A Variety of metrics use this Function Point such as -

• Cost = \$ / FP
• Quality = Errors / FP
• Productivity = FP / person-month

Software Engineering Topics