Skip to main content
Log in

Impact of class attributes on cognitive complexity

  • Original Article
  • Published:
International Journal of System Assurance Engineering and Management Aims and scope Submit manuscript

Abstract

Understanding, an internal process of human beings, is difficult to measure but not impossible. Therefore attempts have been made to measure the understandability of software system in terms of its complexity. Understandability of source code can be measured in terms of its cognitive complexity which is also called psychological complexity. This paper presents a metrics for measuring understandability of a class integral to Object Oriented Software System. The manuscript proposes metrics for measuring cognitive complexity of class due to its attributes. The proposed metrics takes into consideration the complexity introduced by data types of attributes that forms data elements of a class. The primitive, system defined and user-defined data types, used for defining the attributes have been weighted to measure the cognitive complexity of a class. Also an empirical study has been performed to gain insight on the correlation between the proposed measure and the understandability of the program. The results show the significance of measuring contribution of attributes towards cognitive complexity of a class. A metrics meant to measure cognitive complexity of a class should consider weighted measure of complexity introduced by different attributes of a class.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11

Similar content being viewed by others

References

  • Atkinson DC, Griswold WG (1998) Effective whole-program analysis in the presence of pointers. In: Proceedings of the 6th ACM SIGSOFT international symposium on foundations of software engineering, SIGSOFT ’98/FSE-6, pp 46–55, New York, NY, USA, ACM

  • Bandi RK, Vaishnavi VK, Turk DE (2003) Predicting maintenance performance using object-oriented design complexity metrics. IEEE Trans Softw Eng 29:77–87

    Article  Google Scholar 

  • Bastani FB, Iyengar SS (1987) The effect of data structures on the logical complexity of programs. Commun ACM 30:250–259

    Article  Google Scholar 

  • Bennett KH, Cornelius BJ, Munro M, Robson DJ (1988) Software maintenance: a key area for research. Univ Comput

  • Boehm BW, Brown JR, Lipow M (1976) Quantitative evaluation of software quality. In: Proceedings of the 2nd international conference on software engineering, ICSE ’76, pp 592–605, Los Alamitos, CA, USA, 1976 IEEE Computer Society Press

  • Booch G (1986) Object-oriented development. IEEE Trans Softw Eng 12:211–221

    Article  Google Scholar 

  • Bradley JT (2003) An examination of aspect-oriented programming in industry. Technical report

  • Briand LC, Daly JW, Wüst JK (1999) A unified framework for coupling measurement in object-oriented systems. IEEE Trans Softw Eng 25:91–121

    Article  Google Scholar 

  • Cant SN, Ross Jeffery D, Brian H-S (1995) A conceptual model of cognitive complexity of elements of the programming process. Inf Softw Technol 37(7):351–362

    Article  Google Scholar 

  • Chhabra JK, Aggarwal KK, Yogesh S (2003) Code and data spatial complexity: two important software understandability measures. Inf Softw Technol 45(8):539–546

    Article  Google Scholar 

  • Chhabra JK, Aggarwal KK, Yogesh S (2004) Measurement of object-oriented software spatial complexity. Inf Softw Technol 46:689–699

    Article  Google Scholar 

  • Chidamber SR, Kemerer CF (1994) A metrics suite for object oriented design. IEEE Trans Softw Eng 20:476–493

    Article  Google Scholar 

  • Corbi TA (1989) Program understanding: challenge for the 1990’s. IBM Syst J 28:294–306

    Article  Google Scholar 

  • Cruz-Lemus JA, Maes A, Genero M, Poels G, Piattini M (2010) The impact of structural complexity on the understandability of uml statechart diagrams. Inf Sci 180(11):2209–2220

    Article  MathSciNet  Google Scholar 

  • Curtis B, Sheppard SB, Milliman P, Borst MA, Love T (1979) Measuring the psychological complexity of software maintenance tasks with the Halstead and McCabe metrics. IEEE Trans Softw Eng 5:96–104

    Article  MATH  Google Scholar 

  • Genero M, Poels G, Piattini M (2008) Defining and validating metrics for assessing the understandability of entity-relationship diagrams. Data Knowl Eng 64:534–557

    Article  Google Scholar 

  • Halstead MH (1977) Elements of software science (operating and programming systems series). Elsevier Science Inc, New York

    Google Scholar 

  • Jindasawat N, Kiewkanya M, Muenchaisri P (2004) Investigating correlation between the object-oriented design maintainability and two sub-characteristics: understandability and modifiability. In: IASSE’04, pp 151–156

  • Kafura D, Reddy GR (1987) The use of software complexity metrics in software maintenance. IEEE Trans Softw Eng 13:335–343

    Article  Google Scholar 

  • Laitinen K (1996) Estimating understandability of software documents. SIGSOFT Softw Eng Notes 21:81–92

    Article  Google Scholar 

  • Li W, Henry S (1993) Object-oriented metrics that predict maintainability. J Syst Softw 23(2):111–122

    Article  Google Scholar 

  • McCabe TJ (1976) A complexity measure. IEEE Trans Softw Eng 2(4):308–320

    Article  MathSciNet  MATH  Google Scholar 

  • Miller GA (1956) The magical number seven plus or minus two: some limits on our capacity for processing information. Psychol Rev 63(2):81–97

    Article  Google Scholar 

  • Misra S (2006) Modified cognitive complexity measure. In: Levi A, Savas E, Yenign H, Balcisoy S, Saygin Y (eds) Computer and information sciences ISCIS 2006, volume 4263 of Lecture Notes in Computer Science. Springer, Berlin, pp 1050–1059

  • Misra S, Akman I (2008) A model for measuring cognitive complexity of software. In: KES (2), pp 879–886

  • Munson JC, Werries DS (1996) Measuring software evolution. In: Proceedings of the 3rd international symposium on software metrics: from measurement to empirical results, METRICS ’96

  • Ottenstein KJ, Ottenstein LM (1984) The program dependence graph in a software development environment. SIGPLAN Notices 19:177–184

    Article  Google Scholar 

  • Sheldon FT, Jerath K, Chung H (2002) Metrics for maintainability of class inheritance hierarchies. J Softw Maint 14:147–160

    Article  MATH  Google Scholar 

  • Singh Y, Kaur A, Malhotra R (2010) Empirical validation of object-oriented metrics for predicting fault proneness models. Softw Qual Control 18:3–35

    Article  Google Scholar 

  • Wang Y, Shao J (2003) Measurement of the cognitive functional complexity of software. In: IEEE ICCI, pp 67–74

  • Weyuker EJ (1988) Evaluating software complexity measures. IEEE Trans Softw Eng 14:1357–1365

    Article  MathSciNet  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Kalpana Johari.

Appendix 1: Program for GCD, written in three variations

Appendix 1: Program for GCD, written in three variations

See Figs. 12, 13 and 14.

Fig. 12
figure 12

Program with array type data

Fig. 13
figure 13

Program with primitive data types

Fig. 14
figure 14

Program with pointer type data types

Rights and permissions

Reprints and permissions

About this article

Cite this article

Johari, K., Kaur, A. Impact of class attributes on cognitive complexity. Int J Syst Assur Eng Manag 3, 284–299 (2012). https://doi.org/10.1007/s13198-012-0135-4

Download citation

  • Received:

  • Revised:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s13198-012-0135-4

Keywords

Navigation