Skip to main content
Top
Published in: Empirical Software Engineering 1/2019

11-06-2018

Syntax, predicates, idioms — what really affects code complexity?

Authors: Shulamyt Ajami, Yonatan Woodbridge, Dror G. Feitelson

Published in: Empirical Software Engineering | Issue 1/2019

Log in

Activate our intelligent search to find suitable subject content or patents.

search-config
loading …

Abstract

Program comprehension concerns the ability to understand code written by others. But not all code is the same. We use an experimental platform fashioned as an online game-like environment to measure how quickly and accurately 220 professional programmers can interpret code snippets with similar functionality but different structures; snippets that take longer to understand or produce more errors are considered harder. The results indicate, inter alia, that for loops are significantly harder than if s, that some but not all negations make a predicate harder, and that loops counting down are slightly harder than loops counting up. This demonstrates how the effect of syntactic structures, different ways to express predicates, and the use of known idioms can be measured empirically, and that syntactic structures are not necessarily the most important factor. We also found that the metrics of time to understanding and errors made are not necessarily equivalent. Thus loops counting down took slightly longer, but loops with unusual bounds caused many more errors. By amassing many more empirical results like these it may be possible to derive better code complexity metrics than we have today, and also to better appreciate their limitations.

Dont have a licence yet? Then find out more about our products and how to get one now:

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Footnotes
1
Subjects who did not answer the academic degree questions were assigned to the group of no degree.
 
Literature
go back to reference Agresti A, Kateri M (2011) Categorical data analysis. Springer, BerlinMATH Agresti A, Kateri M (2011) Categorical data analysis. Springer, BerlinMATH
go back to reference Coe R (2002) It’s the effect size, stupid: what effect size is and why it is important. In: Conference in British educational research association Coe R (2002) It’s the effect size, stupid: what effect size is and why it is important. In: Conference in British educational research association
go back to reference Curtis B, Sheppard SB, Milliman P (1979) Third time charm: stronger prediction of programmer performance by software complexity metrics. In: 4th international conference software and engineering Curtis B, Sheppard SB, Milliman P (1979) Third time charm: stronger prediction of programmer performance by software complexity metrics. In: 4th international conference software and engineering
go back to reference Gamma E, Helm R, Johnson R, Vlissides J (1994) Design patterns: elements of reusable object-oriented software. Addison-Wesley, BostonMATH Gamma E, Helm R, Johnson R, Vlissides J (1994) Design patterns: elements of reusable object-oriented software. Addison-Wesley, BostonMATH
go back to reference Herraiz I, Hassan AE (2011) Beyond lines of code: do we need more complexity metrics?. In: Oram A, Wilson G (eds) Making software: what really works, and why we believe it. O’Reilly Media Inc., pp 125–141 Herraiz I, Hassan AE (2011) Beyond lines of code: do we need more complexity metrics?. In: Oram A, Wilson G (eds) Making software: what really works, and why we believe it. O’Reilly Media Inc., pp 125–141
go back to reference Landman D, Serebrenik A, Vinju J (2014) Empirical analysis of the relationship between CC and SLOC in a large corpus of Java methods. In: International conference software maintenance & evolution Landman D, Serebrenik A, Vinju J (2014) Empirical analysis of the relationship between CC and SLOC in a large corpus of Java methods. In: International conference software maintenance & evolution
go back to reference Lumley T, Diehr P, Emerson S, Chen L (2002) The importance of the normality assumption in large public health data sets. Ann Rev of Publ Health 23 (1):151–169CrossRef Lumley T, Diehr P, Emerson S, Chen L (2002) The importance of the normality assumption in large public health data sets. Ann Rev of Publ Health 23 (1):151–169CrossRef
go back to reference Myers RH, Montgomery DC, Vining GG, Robinson TJ (2010) Generalized linear models: with applications in engineering and the sciences. Wiley, HobokenMATHCrossRef Myers RH, Montgomery DC, Vining GG, Robinson TJ (2010) Generalized linear models: with applications in engineering and the sciences. Wiley, HobokenMATHCrossRef
go back to reference Newell A, Rosenbloom PS (1981) Mechanisms of skill acquisition and the law of practice. In: Anderson JR (ed) Cognitive skills and their acquisition. Lawrence Erlbaum Association, pp 1–55 Newell A, Rosenbloom PS (1981) Mechanisms of skill acquisition and the law of practice. In: Anderson JR (ed) Cognitive skills and their acquisition. Lawrence Erlbaum Association, pp 1–55
go back to reference Parnin C, Siegmund J, Peitek N (2017) On the nature of programmer expertise. In: 28th psychology of programming interest group annals workshop Parnin C, Siegmund J, Peitek N (2017) On the nature of programmer expertise. In: 28th psychology of programming interest group annals workshop
go back to reference Pink DH (2009) Drive: The surprising truth about what motivates us. Tiverhead Hardcover Pink DH (2009) Drive: The surprising truth about what motivates us. Tiverhead Hardcover
go back to reference Rich C (1987) Inspection methods in programming: Clichés and plans. A.I. Memo 1005, MIT Artificial Intelligence Laboratory Rich C (1987) Inspection methods in programming: Clichés and plans. A.I. Memo 1005, MIT Artificial Intelligence Laboratory
go back to reference Rilling J, Klemola T (2003) Identifying comprehension bottlenecks using program slicing and cognitive complexity metrics. In: 11th IEEE international workshop program comprehension, pp 115–124 Rilling J, Klemola T (2003) Identifying comprehension bottlenecks using program slicing and cognitive complexity metrics. In: 11th IEEE international workshop program comprehension, pp 115–124
go back to reference Sonnentag S, Niessen C, Volmer J (2006) Expertise in software design. In: Ericsson KA, Charness N, Feltovich PJ, Hoffman RR (eds) The Cambridge handbook of expertise and expert performance. Cambridge University Press, pp 373–387 Sonnentag S, Niessen C, Volmer J (2006) Expertise in software design. In: Ericsson KA, Charness N, Feltovich PJ, Hoffman RR (eds) The Cambridge handbook of expertise and expert performance. Cambridge University Press, pp 373–387
go back to reference Vinju JJ, Godfrey MW (2012) What does control flow really look like? Eyeballing the cyclomatic complexity metric. In: 12th IEEE international working conference source code analysis & manipulation Vinju JJ, Godfrey MW (2012) What does control flow really look like? Eyeballing the cyclomatic complexity metric. In: 12th IEEE international working conference source code analysis & manipulation
go back to reference Welch BL (1938) The significance of the difference between two means when the population variances are unequal. Biometrika 29(3/4):350–362MATHCrossRef Welch BL (1938) The significance of the difference between two means when the population variances are unequal. Biometrika 29(3/4):350–362MATHCrossRef
Metadata
Title
Syntax, predicates, idioms — what really affects code complexity?
Authors
Shulamyt Ajami
Yonatan Woodbridge
Dror G. Feitelson
Publication date
11-06-2018
Publisher
Springer US
Published in
Empirical Software Engineering / Issue 1/2019
Print ISSN: 1382-3256
Electronic ISSN: 1573-7616
DOI
https://doi.org/10.1007/s10664-018-9628-3

Other articles of this Issue 1/2019

Empirical Software Engineering 1/2019 Go to the issue

Premium Partner