A Complexity Measure Based on Cognitive Weights



Similar documents
A New Cognitive Approach to Measure the Complexity of Software s

Research Paper. (Received 25 August 2009; Accepted 31 December 2009) 1. Introduction

Analysis and Evaluation of Quality Metrics in Software Engineering

Complexity Metrics for Business Process Models

Business Process Quality Metrics: Log-based Complexity of Workflow Patterns

From Workflow Design Patterns to Logical Specifications

EVALUATING METRICS AT CLASS AND METHOD LEVEL FOR JAVA PROGRAMS USING KNOWLEDGE BASED SYSTEMS

Reasons for need for Computer Engineering program From Computer Engineering Program proposal

FPGA area allocation for parallel C applications

CSE373: Data Structures and Algorithms Lecture 3: Math Review; Algorithm Analysis. Linda Shapiro Winter 2015

Proposed Software Testing Using Intelligent techniques (Intelligent Water Drop (IWD) and Ant Colony Optimization Algorithm (ACO))

EXTENDED ANGEL: KNOWLEDGE-BASED APPROACH FOR LOC AND EFFORT ESTIMATION FOR MULTIMEDIA PROJECTS IN MEDICAL DOMAIN

Software Cognitive Complexity Measure Based on Scope of Variables

Computation of Forward and Inverse MDCT Using Clenshaw s Recurrence Formula

Bachelor Degree in Informatics Engineering Master courses

How To Secure Cloud Computing, Public Auditing, Security, And Access Control In A Cloud Storage System

Optimal Resource Allocation for the Quality Control Process

ESTIMATING COMPLEXITY OF A SOFTWARE CODE

How To Get A Computer Science Degree At Appalachian State

A Review and Analysis of Software Complexity Metrics in Structural Testing

A Direct Numerical Method for Observability Analysis

A Dynamic Programming Approach for Generating N-ary Reflected Gray Code List

Software Testing Strategies and Techniques

Different Approaches to White Box Testing Technique for Finding Errors

Keywords Distributed Computing, On Demand Resources, Cloud Computing, Virtualization, Server Consolidation, Load Balancing

A Performance Study of Load Balancing Strategies for Approximate String Matching on an MPI Heterogeneous System Environment

350 Serra Mall, Stanford, CA

A New Approach For Estimating Software Effort Using RBFN Network

SECURE CLOUD STORAGE PRIVACY-PRESERVING PUBLIC AUDITING FOR DATA STORAGE SECURITY IN CLOUD

A methodology for measuring software development productivity using Eclipse IDE

Software Testing & Analysis (F22ST3): Static Analysis Techniques 2. Andrew Ireland

YOKING OBJECT ORIENTED METRICS THROUGH MUTATION TESTING FOR MINIMIZING TIME PERIOD RAMIFICATION

REAL TIME TRAFFIC LIGHT CONTROL USING IMAGE PROCESSING

RULE BASED EXPERT SYSTEM FOR SELECTING SOFTWARE DEVELOPMENT METHODOLOGY

The Relevance of CS and SE Education: A Survey

Horizontal Aggregations In SQL To Generate Data Sets For Data Mining Analysis In An Optimized Manner

Abstraction in Computer Science & Software Engineering: A Pedagogical Perspective

How To Use Neural Networks In Data Mining

CS556 Course Project Performance Analysis of M-NET using GSPN

Master Degree Program in Computer Science (CS)

AN EFFICIENT STRATEGY OF AGGREGATE SECURE DATA TRANSMISSION

Measuring the Reusable Quality for XML Schema Documents

ALFAISAL UNIVERSITY COLLEGE OF ENGINEERING

Cash Forecasting: An Application of Artificial Neural Networks in Finance

Memory Allocation Technique for Segregated Free List Based on Genetic Algorithm

A Contribution to Expert Decision-based Virtual Product Development

Computer Science. General Education Students must complete the requirements shown in the General Education Requirements section of this catalog.

International Journal of Engineering Research ISSN: & Management Technology November-2015 Volume 2, Issue-6

STUDY AND SIMULATION OF A DISTRIBUTED REAL-TIME FAULT-TOLERANCE WEB MONITORING SYSTEM

Spring 2011 Prof. Hyesoon Kim

Professional Organization Checklist for the Computer Science Curriculum Updates. Association of Computing Machinery Computing Curricula 2008

Client Perspective Based Documentation Related Over Query Outcomes from Numerous Web Databases

Development of Performance Testing Tool for Railway Signaling System Software

Design and Code Complexity Metrics for OO Classes. Letha Etzkorn, Jagdish Bansiya, and Carl Davis. The University of Alabama in Huntsville

Software Metrics in Static Program Analysis

Tool Support for Inspecting the Code Quality of HPC Applications

International Journal of Computer Science Trends and Technology (IJCST) Volume 3 Issue 4, Jul-Aug 2015

SOFTWARE COMPLEXITY MEASUREMENT

Web Usage mining framework for Data Cleaning and IP address Identification

Random Testing: The Best Coverage Technique - An Empirical Proof

An Overview of Distributed Databases

Attack graph analysis using parallel algorithm

Matthias F.M. Stallmann Department of Computer Science North Carolina State University Raleigh, NC

Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C

Static Analysis of Dynamic Properties - Automatic Program Verification to Prove the Absence of Dynamic Runtime Errors

Clinic + - A Clinical Decision Support System Using Association Rule Mining

A STUDY OF TASK SCHEDULING IN MULTIPROCESSOR ENVIROMENT Ranjit Rajak 1, C.P.Katti 2, Nidhi Rajak 3

Informatica e Sistemi in Tempo Reale

Project Knowledge Management Based on Social Networks

Number of hours in the semester L Ex. Lab. Projects SEMESTER I 1. Economy Philosophy Mathematical Analysis Exam

Lund, November 16, Tihana Galinac Grbac University of Rijeka

Comparison of Request Admission Based Performance Isolation Approaches in Multi-tenant SaaS Applications

Computational Modeling and Simulation for Learning an Automation Concept in Programming Course

How To Fix Out Of Focus And Blur Images With A Dynamic Template Matching Algorithm

FINANCIAL RISK EVALUATION BY THE TREE OF PROBABILITY DECISIONS METHOD Mariya Bruseva Varna Free University, Bulgaria

On a Hadoop-based Analytics Service System

Analysis and Enhancement of QoS in Cognitive Radio Network for Efficient VoIP Performance

International Journal of Computer Engineering and Applications, Volume V, Issue III, March 14

Measuring Software Complexity to Target Risky Modules in Autonomous Vehicle Systems

Aspect-Oriented Software Development based Solution for Intervention Concerns Problems:Case Study

ReBEC: a Method for Capturing Experience during Software Development Projects

2.1. The Notion of Customer Relationship Management (CRM)

A Simultaneous Solution for General Linear Equations on a Ring or Hierarchical Cluster

Keywords Cloud Storage, Error Identification, Partitioning, Cloud Storage Integrity Checking, Digital Signature Extraction, Encryption, Decryption

IMPROVING BUSINESS PROCESS MODELING USING RECOMMENDATION METHOD

Transcription:

International Journal of Theoretical and Applied Computer Sciences Volume 1 Number 1 (2006) pp. 1 10 (c) GBS Publishers and Distributors (India) http://www.gbspublisher.com/ijtacs.htm A Complexity Measure Based on Cognitive Weights Sanjay Misra Department of Computer Engineering Atilim University, Ankara, Turkey smisra@atilim.edu.tr Abstract Cognitive Informatics plays an important role in understanding the fundamental characteristics of software. This paper proposes a model of the fundamental characteristics of software, complexity in terms of cognitive weights of basic control structures. Cognitive weights are degree of difficulty or relative time and effort required for comprehending a given piece of software, which satisfy the definition of complexity. An attempt has also been made to prove the robustness of proposed complexity measure by comparing it with the other measures based on cognitive informatics. Keywords: Software complexity, cognitive weights, basic control structures. 1. Introduction Many well known software complexity measures have been proposed such as McCabe s cyclomatic number [9], Halstead programming effort [4], Oviedo s data flow complexity measures [10], Basili s measure [2,3],Wang s cognitive complexity measure[16], Knot complexity [12] and others [1,5, 6, 7]. All the reported complexity measures are supposed to cover the correctness, effectiveness and clarity of software and to provide good estimate of these parameters. Out of the numerous proposed measures, selecting a particular complexity measure is again a problem, as every measure has its own advantages and disadvantages. There is an ongoing effort to find such a comprehensive complexity measure, which addresses most of the parameters of software [11]. The complexity measures based on cognitive informatics is in developing phase. Cognitive complexity measures are the human effort needed to perform a task or difficulty in understanding the software. In this paper, an attempt has been made to develop a very simple method for calculating the complexity of code in terms of

2 Sanjay Misra cognitive weights. This method is the most suitable due to not only its simplness but also it provides the complete information about the information contents of a program. In section 2, we discussed the other complexity measure based on cognitive informatics. In section 3, we propose a new complexity measure with its formulation. The comparison of the proposed measure with the others has been done in section 4. The conclusion is given section 5. 2. Cognitive Weights and Cognitive Informatics In cognitive informatics, it is found that the functional complexity of software in design and comprehension is dependent on internal architecture of the software. Basic control structures (BCS), sequence, branch and iteration [13, 14, 15] is the basic logic building blocks of any software. The cognitive weight of software [16] is the extent of difficulty or relative time and effort for comprehending a given software modeled by a number of BCS s. There are two different architectures for calculating W bcs : either all the BCS s are in a linear layout or some BCS s are embedded in others. For the former case, sum of the weights of all n BCS s; are added and for the latter, cognitive weights of inner BCS s are multiplied with the weights of external BCS s. The cognitive weights for Basic Control Structures are as under: Category BCS Weight Sequence Sequence (SEQ) 1 Branch If-Then-Else (ITE) 2 Case 3 Iteration For-do 3 Repeat-until 3 While-do 3 Embedded Component Function Call (FC) 2 Recursion (REC) 3 Concurrency Parallel (PAR) 4 Interrupt (INT) 4 Table 1: Basic control structures and their Cognitive Weight Kushwaha and Misra [7] has proposed a complexity measure, which includes the information contents of software. They consider the theory of Wang [17], which explains that software obeys the laws of Informatics and the Cognitive Science based on the following assertions: ƒsoftware represents computational information. ƒsoftware is a mathematical entity. ƒsoftware is the coded solution to a given program.

A Complexity Measure Based on Cognitive Weights 3 ƒsoftware is a set of behavioral instructions to computer. According to Wang [17], Information is the third essence in modeling the natural world supplement to matter and energy. Wang [18] defines software, as Software in cognitive informatics is perceived as formally described design information and implementations instructions of computing application. In other words, Wang proved that complexity of any software is in the form of complexity of understanding of the information contained. Hence, the cognitive complexity of the software should be based on the measure that takes into account the total amount of information contained in the software. 3. Cognitive Weight Complexity Measure (CWCM) By considering the above theories, the author is in favor of that, although cognitive functional size approach is good but one can find the same conclusion only by the consideration of cognitive weights. Cognitive weights itself provide the sufficient information about the information contained in the software. In the next section, it is proved by comparing this approach with the cognitive functional size approach. There is no need to add more information in cognitive weight measurement for complexity value calculation. Kushwaha and Misra [7] has tried to modify the functional size approach, but it is shown in the next section that there are very much similarity of their approach with functional size approach. Therefore, his proposal also does not contribute very much. In this proposal, we consider that our cognitive weight complexity measure depends upon: The Cognitive Weights of Basic Control Structures In fact, cognitive weights correspond to the number of executed instructions. For example, if in a simple program without any loop, the processor executes only once at the run time. So the weights assigned to such code is one. Cognitive weights of basic control structures are basic building blocks of software and the standard weights for different control structures are given in Table-1. The total cognitive weight of a software component W c is defined as the sum of cognitive weight of its q linear blocks composed in individuals BCS S. Since each block may consists of m layers of nesting BCS s, and each layer with n linear BCS s, the total cognitive weight, W c can be calculated by: q m n Wc = Wc ( j, k, i) (CW U ) (1) j= 1 k = 1 i= 1 The unit of cognitive weight complexity measure is defined as the cognitive weight of the simplest software component i.e. a linear structured BCS i.e. CWCM = f (W bcs ) = 1 Cognitive Weight Unit (CWU) The above measure has been illustrated with the help of an example below. Example 1. An algorithm to calculate the average of a set of numbers as shown in Figure-1 is used to illustrate the application of CWCM to measure the complexity

4 Sanjay Misra # define N 10 main () { int count; float sum, average, number; sum=0; count=0; while(count<n) { scanf( %f,&number); sum = sum +number; count = count +1; } average= sum/n; printf( N=%dsum = %f, N,sum); printf( average = %f,average), } Figure-1: An algorithm to calculate the average of a set of n numbers We illustrate the CWCM to calculate the complexity of the above program as under: BCS (sequence) W 1 = 1 BCS (iteration) W 2 = 3 W c = W 1 +W 2 =1+3 = 4 CWCM = W c = 4 CWU Then, the cognitive complexity measure value of the algorithm is 4 CWU. 4. Comparative Study of Cognitive Weight Complexity Measures with Others In this section, we have taken different C program from [8] for analysis of the result. We calculated the Cognitive Weight Complexity Measure (CWCM) for different programs. Then, we compared Cognitive Weight Complexity measure with cognitive functional size. The value of Cognitive weight complexity measure and cognitive functional size are given in the table 2. The CWCM for all the programs gives lower complexity values when we compare it with cognitive functional size approach. It can be easily seen that CWCM already includes the considerations of information contained in terms of cognitive weights. It is also worth mentioned that lower complexity value in terms of number is considered better measure in comparison of measures, which gives higher complexity value.

A Complexity Measure Based on Cognitive Weights 5 CWCM has also been compared with cognitive information complexity measure as illustrated in table below, table 3. No. Cognitive Weights (CW) Cognitive Functional Size(CFS) Ref of source code 1 7 21 Fig 7 2 4 8 Fig 1 3 7 14 Fig 6 4 10 30 Fig 8 5 15 30 Fig 5 6 3 9 Fig 2 7 3 9 Fig 3 8 21 42 Fig 4 Table 2: Complexity values for CWCM & CFS No Cognitive weight complexity measure(cwcm) Cognitive Information complexity measure(cicm) Software functional size (CFS) 1 4 19 12 2 2 3 2 3 4 19 16 4 21 97 42 5 15 19 30 6 7 30 14 7 8 83 24 8 4 22 16 9 3 10 9 10 4 14 16 Table 3: Complexity values for CWCM, CICM and CFS. A plot for CWCM, CICM and CFS is shown in fig 2. (Instead of below). The plot in fig 2 shows the trends of cognitive weight complexity measure with cognitive information complexity measure. It is seen that the trends of each graph is almost similar, if the complexity value is high for some program, then it reflects in all the graphs. This comparative study proves the similarity between all the complexity measures. Once, we are getting the appropriate information by a small number and by simple calculation, there is no need to adopt the complex method for the same information. It also proves the robustness of this measure.

6 Sanjay Misra 120 100 80 complexity Values 60 Series1 Series2 Series3 40 20 0 1 2 3 4 5 6 7 8 9 10 programs Series 1: Cognitive weight complexity measure, Series 2 : CICM Series 3: CFS Figure-2: Graph for CWCM, CICM and CFS 5. Conclusion A complexity measure based on cognitive weight is proposed. It is found that cognitive weight complexity measure is the most suitable measure, when it is compared with other similar measures. The most important feature of this measure is that it is simple to understand, easy to calculate, less time consuming, gives the complexity value in terms of small number, and language independent i.e. it satisfy most of the property of a good measure. It will aid the developers and practitioners in evaluating the software complexity due to its simple ness, which serves both as an analyzer and as a predicator in quantitative software engineering. 6. Acknowledgement I am highly thankful to Prof. Ibraham Akman, chair of the department for his encouragement and support during the work. I am also thankful to my collogues Dr. Alok Mishra and Dr. Hurevren Kilic for useful discussion. References [1] Baker, A.L., and Zweben, S.H. (1980), A comparison of Measures of control flow Complexity, IEEE Transaction on Software Engineering, 6, 506-511. [2] Basili. V.R.,(1980), Qualitative software complexity models: A summary in tutorial on models and methods for software management and engineering. IEEE Computer Society Press, Los Alamitos,CA.

A Complexity Measure Based on Cognitive Weights 7 [3] Basili, V.R.,Selby, R.W and Phillips,T.Y.,(1983) Metric analysis and data validation across fortran projection. IEEE Transactions Software Engineering, SE-9(6):652-663. [4] Halstead. M.H.(1997), Elements of software science, Elsevier North-Holland, New York [5] Harrison, W.,(1992) An entropy-based measure of software complexity. IEEE Transactions on Software Engineering, 18(11): 1025-1029. [6] Kearney, J.K., Sedlmeyer, R.L.,Thompson, W.B., Gray, M.A. and.adler. M.A,(1986) Software complexity measurement. ACM Press, New York, 28:1044-1050. [7] Kushwaha,D.S. and Misra,A.K.(2006). Robustness Analysis of Cognitive Information Complexity Measure using Weyuker Properties, ACM SIGSOFT 6RIWZDUH(QJÕQHHUÕQJ1RWHV-6. [8] Misra S. and Misra. A. K.(2004), Evaluating Cognitive Complexity Measure with Weyuker s properties.proceedings of third IEEE International Conference on Cognitive Informatics,103-108. [9] McCabe. T.H.(1976),A complexity measure. IEEE Transactions Software Engineering, (SE-2,6):308-320. [10] Oviedo, E.I.(1980). Control flow, data and program complexity. Proc. IEEE COMPSAC, Chicago, IL, pages 146-152. [11] Weyuker. E.J.,(1988), Evaluating software complexity measure. IEEE Transaction on Software Complexity Measure, 14(9): 1357-1365. [12] Woodward, M. R., Hennel. M. A., David. H.,( 1979) A measure of control flow complexity in program text. IEEE Transaction on Software Engineering, SE-5, Vol. 1, pages 45-50. [13] Wang. Y.(2002). Component Based Software Measurement in F. Barbier ed. Business Component - Based Software Engineering. 247-262. [14] Wang. Y.(2002). The real-time process algebra (RTPA). Annuals of Software Engineering An International Journal, 14:235-274. [15] Wang. Y. and Shao J.(2002) Y Wang. On cognitive informatics, Keynote Lecture. Proceeding of the 1st IEEE International Conference on Cognitive Informatics, pages 34 42. [16] Wang. Y. and Shao J. (2003). A new measure of software complexity based on cognitive weights, Can.J.Elect. Comput. Eng.,28,2,69-74. [17] Wang. Y.and Shao J. (2004). On cognitive informatics: Foundation of Software Engineering. Proceeding of the 3rd IEEE International Conference on Cognitive Informatics (ICCI'04), IEEE CS Press.22-31. [18] Wang. Y. (2004). On the Informatics Laws of Software. Proceeding of the 1 st IEEE International Conference on Cognitive Informatics (ICCI'02), IEEE CS Press. 132-141.