Software Complexity for Computer Communication and Sensor Networks Using Binary Decision Diagrams Harpreet Singh, Adam Mustapha, Arati M Dixit, Kuldip Singh, Grant R. Gerhart Abstract--Software complexity has been a topic of interest for software engineers for the last three decades. Various definitions of software complexity have appeared in literature from time to time. This has resulted in the development of software metrics by different investigators. With the new developments in the area of computer communication and sensor networks, software complexity metrics need an improvement so that they can be used for internet, computer communication networks, and sensor networks. It is difficult to apply the existing definitions of software complexity to internet applications. The objective of the present paper is to propose a definition which could be used for internet and sensor networks applications. In this paper a new definition of software complexity is utilized for the proposed applications. It is suggested to use Binary Decision Diagrams for this purpose as these diagrams result in disjoint expression which is needed in the calculation of the software complexity. Simple cases of software complexity for series, parallel, series-parallel and non series-parallel networks are investigated. The simulation of the proposed algorithm is given in this paper. The complexity between two nodes of a graph can be determined with the help of path expressions between the two nodes of interest of a graph. Binary Decision Diagram approach is then utilized to determine the complexity between two terminal nodes of a graph. The approach is applicable to any number of nodes and branches of a graph. It is hoped that this approach will be extensively used by software engineers who are developing software for internet, computer communication networks, and sensor networks. Harpreet Singh,
[email protected], Adam Mustapha,
[email protected] Arati M Dixit,
[email protected] Department of Electrical and Computer Engineering, Wayne State University Detroit, MI 48202 Kuldip Singh with Department of Electrical and Computer Engineering, IIT Roorkee, India, 247667 Grant R. Gerhart,
[email protected], U.S. Army Tank Automotive Command Research, Development and Engineering Center, Warren, MI 48088
Index Terms—software complexity, software reliability, fuzzy logic, binary decision diagrams, boolean algebra, MATLAB.
I. INTRODUCTION
Software
complexity is a very important
metric used in software engineering. While developing software it is important to predict the complexity of software in advance. If the complexity is more then the desired complexity, changes can be made in the development process to obtain the prescribed complexity. It is important to know this metric in the early stages of the software development. Knowing complexity at later stages results in high development costs of the software. Because of these reasons there has been on ongoing research in determining various definitions of complexity. With increasing popularity of internet, the complexity definitions have to be modified so as to meet the increasing demand of software development for internet applications. The existing definitions of complexity are not suitable for internet application. In this paper, a new definition of software complexity is suggested so that this definition can be applied to internet software development [1]. Here in the software complexity is defined from zero to one rather then the previous definition of number of lines of code, number of operators and operands, number of loops, etc. Halstead [2], [28] defined software complexity in terms operators and operands. McCabe [3] defined the software complexity in terms of the number of loops in the software. This was followed by a number of other workers [4]-[6] who gave different definitions of software complexity. Table I. has various definitions of software complexity. In order to define software complexity between zero and one, we suggest Boolean algebra approach here. We essentially suggest the same approach which has been used by several investigators in determining the reliability of computer communication network [7]-[16]. The same approach can be useful for internet and
sensor network applications, So long as the problem can represented as a graph, these approaches can be applied. In this paper we suggest Binary Decision Diagrams approach to determine the complexity of sensor network. Binary Decision Diagrams became popular when the conventional truth table approaches could not be applied for a large number of variables. With the coming of internet and sensor network, a number of nodes and branches of under consideration have become extremely large. Because of the fact that Binary Decision Diagrams approach can be used for a large number of variables, hence such an approach is suggested in the present work.
TABLE 1
SOFTWARE COMPLEXITY Authors/Year McCabe 1976 Halstead 1977 Ramamorthy and Melton 1988 Lisa Anneberg 1991 Munson and Khoshgoftaar 1992
Software Complexity Cyclomatic complexity Length of program and Effort
In Terms of Loops Operands and Operators
Family of measures Patri net 'A' matrix complexity
Weighted measures Order of 'A' matrix
Relative complexity
Factor Analysis
II. A BRIEF REVIEW OF BINARY DECISION DIAGRAMS Binary Decision Diagrams (BDD) [16]-[19] have become popular for the last three decades. The importance of Binary Decision Diagram was observed especially with the development of new techniques for finding faults for very large VLSI circuits. However, these diagrams have attracted the attention of investigators in different fields. In this paper we develop a procedure so as to illustrate how Binary Decision Diagrams can be useful in determining the software complexity for computer communication networks. Complexity using Binary Decision Diagrams will be of interest to logic circuit fault tolerant and VLSI design community. These diagrams are
useful for both sequential circuits.
combination
circuits
and
III. REVIEW OF SOFTWARE COMPLEXITY OF SIMPLE NETWORKS The software complexity of circuits has been studied for the last four decades extensively in the literature [2]-[6], [10], [20]-[22]. The software complexity of branches in series, branches in Parallel, and branches in non-series parallel has been the subject of research papers [1]. Currently, sensors networks have become very popular in literature because of their applications in different areas. The purpose of this paper is to utilize how Binary Decision Diagrams can be useful in determining the software complexity for computer communication and sensors networks. For completeness, a review of Binary Decision Diagrams is briefly given first. Fig. 2 illustrates the software complexity of paths in series, in parallel, in series-parallel and non-series parallel. Both paths and binary decision diagrams for each case are given. More complex software is less reliable and vice versa. The software reliability has a range of zero to one; hence software complexity is also defined as to have a range of zero to one. Further, these definitions are extended so that the complexity of interconnected network can be defined. Consider two branches in series having software complexity as 0.9 and 0.8. The uncomplexity (reliability) of these branches will be 0.1 and 0.2 respectively. The reliability (uncomplexity) of series path will be equal to 0.1* 0.2 = 0.02. Hence the complexity will be of the series path will be 10.02 = 0.98. Next consider two parallel paths having complexity 0.9 and 0.8. Their uncomplexity (reliability) will be 0.1 and 0.2 respectively. So the reliability (uncomplexity) of the two paths in parallel will be equal to 0.1 + 0.2 – 0.1* 0.2 which will be equal to 0.28. Hence the software complexity of two parallel paths is 1- 0.28 = 0.72. Next consider two series parallel paths (x1 and x2 in parallel with x3 and x4) having complexities equal to 0.9 and 0.8 for the series path and 0.7 and 0.6 for the other path in parallel. The complexity of the series path will be 0.98 and 0.88. The
uncomplexity of the two parallel paths are 0.2 and 0.12 respectively. The overall uncomplexity is 0.02 + 0.12 – 0.02 * 0.12 = 0.1376. Hence the overall series parallel complexity will be equal to 1 – 0.1376 = 0.8624.
x1
We cannot find out complexity of non-series parallel network by simple calculation. However by using Boolean Algebra technique and by finding a disjoint (non-overlapping) expression one can determine the terminal complexity of the non-series parallel network as 0.835. The terminal software complexity value of each network is given in a Table 2 These values can be easily determined with the help of conventional techniques given in reference [1]. However, in this paper these values can be determined through Binary Decision Diagrams and with the software developed using Fuzzy Logic [24]-[26] MATLAB toolbox [27].
x2
F X1
1
0 x2
0
1
0
1
0
Fig. 2a. Series network and its Binary decision diagram . X1
1
2
x2 F
TABLE 2
GRAPHS AND THEIR TERMINAL RELIABILITY Graph
c1
x1
c2
1
x2
1
0
0.98
0.72
c1
1
0
Terminal software complexity
1
0 Fig. 2b. Parallel network and its Binary decision diagram 2 x2
x1
c2
1
c1
c2
c3
c4
3 x3
0.8624
4
F X1
0
c1 c3
c5
c2
0.835
1
X3
0
X2
1
0 0
X4
X3
1 1
0
X4
0 1
0
1
0
1
c4
x4
1
0 0
1
Fig. 2c. Series parallel network and its Binary decision diagram 3.
2
X1
X2
X5
1
3
X3
4.
X4
4
f
5.
variables correspond to the different branches. Determine a disjoint expression corresponding to the Boolean expression given in step 2. Given the disjoint Boolean expression, substitute the corresponding values of branch software uncomplexity. The terminal software complexity = 1 uncomplexity
X1 0
1
X2 X2
0
1
X3 0
0
X3 1
0
1
0 X4
X4 1 0
0
1
0
X3 1
V. ALGORITHM FOR TERMINAL SOFTWARE COMPLEXITY USING BINARY DECISION DIAGRAMS
1
X4
1
0
X4 1
1
0
1
0 1 0
0
1
X5
1 0 0
X5
0 1
0 1
1
0
1
Fig. 2d. Non-series parallel network and its Binary decision diagram. Fig. 2: Graphs and their Binary decision diagrams
III. TERMINAL SOFTWARE COMPLEXITY (TSC) USING BINARY BECISION DIAGRAMS (BDD)
The terminal software complexity is the software complexity between two terminal nodes. Given a network, it is important to determine branch software complexity between various nodes of a network. The problem is a general one and has applications in several areas such as communication systems and computer programs. Knowing the complexity of each branch, one can determine the terminal software complexity between any two nodes. The Boolean algebra approach has been used by several investigators [10], [14], in determining the terminal reliability of a network. The Boolean algebra technique basically consists of the following steps: 1. 2.
Determine simple paths between two nodes of a graph. Write down the Boolean expression corresponding to the paths where the Boolean
The following steps are used for drawing Binary decision Diagrams. 1. Determine simple paths. 2. Determine the Boolean expressions which correspond to the simple paths. 3. Use Shannon’s expansion theorem to mark the paths. 4. Determine the non-overlapping expressions. 5. Substitute branch software uncomplexity values 6. The terminal software complexity = 1 uncomplexity.
VI. SOFTWARE IMPLEMENTATION We have developed software which can determine the software complexity between any two terminal nodes of graph. The approach is applicable for a graph having any number of nodes and branches. The software has been developed based on the concept of Binary Decision Diagrams. The form below in Fig. 3 is the starting form of the application. This form allows the user to enter • number of wires • number of nodes • number of bidirectional wires • begin node of the desired path • end node of the desired path Desired path is the path for which the complexity is to be calculated. Fig. 3 shows MATLAB displays for terminal complexity for series parallel network with 4 nodes 4 wires example.
Node Count: 4 Wire Count: 4 Bidirectional Count: 0 Desired Path Begin Node: 1 Desired Path End Node: 3 Calculation Type: Complexity Wire specifications of the network: Id Beg. Node End Node Complexity Bidirectional ========================================= 1 1 2 0.90 0.90 No 2 2 3 0.80 0.80 No 3 1 4 0.70 0.70 No 4 4 3 0.60 0.60 No Wire matrix: 1 0 1 0 -1 1 0 0 0 -1 0 -1 0 0 -1 1 Desired path matrix: 1 0 -1 0 Simple path matrix: 0 0 1 1 1 1 0 0 Simple paths: x3x4 + x1x2 Non-overlapping path matrix: 1 1 2 2 1 0 1 1 0 1 1 1 0 0 1 1 Non-overlapping expression: x1x2 + x1(~x2)x3x4 + (~x1)x2x3x4 + (~x1)(~x2)x3x4 Uncomplexity: Section1: 0.0200 Section2: 0.0096 Section3: 0.0216 Section4: 0.0864 Complexity = 1- Uncomplexity = 1- 0.1376 Overall complexity: 0.8624 >>
Fig. 3. Series parallel network with 4 nodes 4 wires example
VI. CONCLUSION In this paper a new technique defining software complexity has been proposed. Contrary to the previous definitions, we suggest a new definition of software complexity where the values of complexity lie between zero and one. Such definition helps in determining the software complexity for internet application. This approach how to determine complexity requires disjoint Boolean expression. In this paper BDD are suggested to obtain disjoint or non-overlapping expression. The proposed procedure has been implemented using MATAB. The procedure is applicable for any number of nodes. It is hoped that this approach of determining software complexity will be utilized by several investigators who will be developing software for internet and sensor applications. Determining software complexity at the earlier stages of the software development goes a long way in reducing the overall cost of software development.
REFERENCES [1]
H. Singh, A. Mustapha, A Dixit, L.Hue, G.Gerhat. “A new software complexity metric for computer communication network,” IASTED SAE 2007, Boston, Massachusetts, no. 591-130, Sept. 2007.
[2] M.H. Halstead,”Elements of software science,” Elsevier North-Holland, New York, 1977. [3] T.J. McCabe. “Complexity measure,” IEEE Trans. Soft Eng., Vol. SE-2, no. 4, pp. 308-320, Dec. 1976. [4] B. Ramamurthy, and A. Melton, "A synthesis of software science measures and cyclomatic number,” IEEE Trans. Software Eng., vol. SE-14, no.8, pp. 1116-1121, August 1988. [5] L. Anneberg. “The role of Petri net 'A' matrix in requirement and specification phase of software engineering,” PhD. Dissertation at Wayne state university, 1991. [6] J.C. Munson, and T.M. Khoshgoftaar. “The detection of fault-pron programs,” IEEE Trans. Soft. Eng., vol. 18, no. 5, pp. 423-433, May 1973. [7] H. Singh, A Mustapha, V. Shaarma, M. Hua, G. Gerhart. “Reliability of computer communication networks using binary decision diagrams” 23rd International conference on computers and their applications (CATA-2008), no. TH-2239, April 2008. [8] K. B. Misra, and T.S.M. Rao. “Reliability analysis of redundant networks using flow graph,” IEEE Trans. Reliability, vol. R-19, no. 1, pp. 19-24, Feb. 1970.
[9] K.K. Aggrawal, and I.M. Soi, "Reliability indices for topological design of computer communication networks,” IEEE Trans. On Reliability, vol. R30, no.5, Dec. 1981. [10] Singh H.; Vaithilingam S.; Anne K.
Anneberg; “Terminal reliability using Binary decision diagrams” Microelectronics Reliability, Vol. 36, No 3, March 1996, pp. 363-365(3). [11] K.K. Aggrawal, K. Gopal, and J.S. Gupta, "An improved algorithm for the reliability optimization,” IEEE Trans. On Reliability, vol. R27, Dec. 1978. [12] M. Tkachtenberg , “A General theory of softwarereliability modeling,” IEEE Trans. On Reliability, vol.39, no. 1, April 1990. [13] Salim Hariri and C.S.Raghavendra ,“ SYREL : A symbolic reliability algorithm based on path and cutset methods”, IEEE Trans. on Computers , VOL. C-36, no. 10, Oct. 1987. [14] L. Fratta, and U. Montanari. “A Boolean algebra method for computing the terminal reliability in communication network,” IEEE Trans. Circuit Theory, vol. CT-20, no. 3, pp. 203-211, May 1973.
[15] Aggarwal, K. Gupta, J. Misra, K.,” A simple method for reliability evaluation of a communication system,” IEEE Communication, Vol. 23, no.5, May, 1975. [16] Erich Strohmaier, “Performance complexity: An execution time metric to characterize the transparency and complexity of performance,” CTWatch Quarterly, Vol. 2, No. 4B, November 2006. [17] Sheldon B. Akers. “Binary decision diagrams,” IEEE Transactions on Computers, C-27(6):509–516, June 1978. [18] Randal E. Bryant. “Dynamic variable ordering for ordered binary decision diagrams,” IEEE 1063-6757, 1993. [19] Randal E. Bryant. “Symbolic boolean manipulation with ordered binary-decision diagrams,” ACM Computing Surveys, vol. 24, no. 3, 1992, 293–318. [20] Dharmendra Singh Kushwaha and A.K. Mishra. “Improved cognitive information complexity measure: a metric that establishes program comprehension effort,” ACM SIGSOFT Software Engineering Notes, Vol. 31, Issue 5, September 2006. [21] Erich Strohmaier, “Performance complexity: An execution time metric to characterize the transparency and complexity of performance,” CTWatch Quarterly, Vol. 2, No. 4B, November 2006. [22] Meng-Lai Yin, Pomona Jon Peterson, Rafael R. Arellano, “Software complexity factor in software reliability assessment,” Reliability and
[23]
[24] [25]
[26]
[27] [28]
Maintainability, 2004 Annual Symposium – RAMS. 2004. Clark Archer, Michael Stinson, “Object-oriented software measures ,” Technical report CMU/SEI-95-TR-002, ESC- TR-95-002, April 1995. L. Zadeh. “Fuzzy Sets,” Inform. Contr., vol. 8, no. 3, pp. 338- 53, 1965. T. Meitzler, L. Arafeh, H. Singh and G. Gerhart , “Fuzzy l logic approach for computing the probability of target detection in cluttered environments,” Opt. Eng., vol. 35, pp. 3623-3636, Dec 1996. Labib Arafeh, Harpreet Singh, Sushil Putatunda,“A neuro fuzzy logic approach to material processing,” Proceedings of IEEE. Vol. 29, No.3, August 1999. Fuzzy Logic Toolbox for use with the MatLab. Natick, MA: Math Works, Jan. 1995. R.S. Pressman, Software engineering practitioner’s approach (New York: McGrawHill, 1976).