Syntax, Predicates, Idioms - What Really Affects Code Complexity?
Authors:
- Shulamyt AjamiSAShulamyt Ajami
- Yonatan WoodbridgeYWYonatan Woodbridge
- Dror G. FeitelsonDFDror G. Feitelson
- 1 May 2017
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 66-76
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 222 professional programmers can interpret code snippets with similar functionality but different structures. 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. By amassing many more empirical results like these it may be possible to derive better code complexity metrics than we have today.Keywords
This publication has 40 references indexed in Scilit:
- Categorical Data Analysis2011
- Using paths to measure, explain, and enhance program behaviorComputer, 2000
- Cognitive processes in program comprehension: An empirical analysis in the Context of software reengineeringJournal of Systems and Software, 1996
- Program comprehension during software maintenance and evolutionComputer, 1995
- Applications of a relative complexity metric for software project managementJournal of Systems and Software, 1990
- A nesting level complexity measureACM SIGPLAN Notices, 1982
- Syntactic/semantic interactions in programmer behavior: A model and experimental resultsInternational Journal of Parallel Programming, 1979
- An extension to the cyclomatic measure of program complexityACM SIGPLAN Notices, 1977
- Letters to the editor: go to statement considered harmfulCommunications of the ACM, 1968
- Exploratory experimental studies comparing online and offline programming performanceCommunications of the ACM, 1968