Code and data spatial complexity: two important software understandability measures
Jitender Kumar Chhabraa,*, K.K. Aggarwalb, Yogesh Singhc a Department of Computer Engineering, National Institute of Technology (Deemed University), Kurukshetra 136119, India b Vice-Chancellor, GGS Indraprastha University, Delhi 110006, India c School of Information Technology, GGS Indraprastha University, Delhi 110006, India Received 5 October 2002; revised 22 February 2003; accepted 3 March 2003
Abstract In order to maintain the software, the programmers need to understand the source code. The understandability of the source code depends upon the psychological complexity of the software, and it requires cognitive abilities to understand the source code. The individual needs to correlate the orientation and location of various entities with their processing, which requires spatial abilities. This paper presents two measures of spatial complexity, which are based on two important aspects of the program—code as well as data. The measures have been applied to 15 different software projects and results have been used to draw many conclusions. The validation of the results has been done with help of perfective maintenance data. Lower values of code as well as data spatial complexity denote better understandability of the source code. q 2003 Elsevier Science B.V. All rights reserved.
Keywords: Code spatial complexity; Data spatial complexity; Understandability; Software metrics; Psychological complexity
1. Introduction In order to control, manage, and maintain software, the software complexity needs to be measured. If you cannot measure it, you cannot control it [7]. There are many aspects of the software. Some of them contribute towards the design and algorithmic complexity, some contribute towards readability and understandability of the software, and some other aspects have an influence
References: [1] K.K. Aggarwal, Y. Singh, J.K. Chhabra, An Integrated Measure of Software Maintainability, Proceedings of Annual Reliability and Maintainability Symposium RAMS-2002—International Symposium on Product Quality and Integrity, Seatle Westin, USA, Jan 28 –31, 2002, pp. 235 –241 [2] K.K. Aggarwal, Y. Singh, J.K. Chhabra, Computing program weakness using module coupling, ACM SIGSOFT 27 (1) (2002) 63–66. [3] A. Baddeley, Human Memory: Theory and Practice, Revised Edition, Hove Psychology Press, 1997. [4] R. Brooks, Towards a theory of the comprehension of computer programs international, Journal of Man-Machine Studies 18 (1983) 543 –554. [5] J.K. Chhabra, Y. Singh, Software maintenance: write software that is easy to maintain, i.t, Information Technology Magazine 10 (7) (2001) 60– 62. [6] S.D. Conte, H.E. Dunsmore, V.Y. Shen, Software Engineering Metrics and Models, Cummings Pub Inc, USA, 1986. [7] T. DeMarco, Controlling Software Projects, Yourdon Press, Englewood Cliffs, NJ, 1982. [8] C.R. Douce, P.J. Layzell, J. Buckley, Spatial Measures of Software Complexity, Technical Report, Information Technology Research Institute, University of Brighton, UK, Jan 1999 [9] N.E. Fenton, S. Fleeger, Software Metrics—A Rigorous and Practical Approach, Thomson International Press, 2002. [10] K. Laitnen, Estimating understandability of software documents, ACM SIGSOFT 21 (1996) 81–92. [11] T.J. McCabe, A complexity measure, IEEE Transactions on Software Engineering SE-2 (4) (1976) 308 –319. [12] J.F. Peters, W. Pedrycz, Software Engineering: an Engineering Approach, Wiley, New York, 2000. [13] Y. Singh, P. Bhatia, Module weakness: a new measure, ACM SIGSOFT 23 (5) (1998) 81–82. [14] T. Tenny, Program readability: procedures versus comments, IEEE Transactions on Software Engineering 14 (9) (1988) 1271– 1279. 7. Conclusion The paper has proposed two measures of understandability of software: code spatial complexity and data spatial complexity. Code spatial complexity measures the efforts required to comprehend the definition of various modules with their uses. Data spatial complexity concentrates on measuring the efforts needed to grasp the purpose and uses of global variables and constants. The study of 15 different projects has been done and these spatial complexities have been measured for all of these projects. The results indicate that the adequate use of global data and software engineering practices helps in getting lesser value of these complexities, resulting into more understandable software.