skip to main content
10.5555/2820282.2820319acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

How programmers read regular code: a controlled experiment using eye tracking

Published: 16 May 2015 Publication History

Abstract

Regular code, which includes repetitions of the same basic pattern, has been shown to have an effect on code comprehension: a regular function can be just as easy to comprehend as an irregular one with the same functionality, despite being longer and including more control constructs. It has been speculated that this effect is due to leveraging the understanding of the first instances to ease the understanding of repeated instances of the pattern. To verify and quantify this effect, we use eye tracking to measure the time and effort spent reading and understanding regular code. The results are that time and effort invested in the initial code segments are indeed much larger than those spent on the later ones, and the decay in effort can be modeled by an exponential or cubic model. This shows that syntactic code complexity metrics (such as LOC and MCC) need to be made context-sensitive, e.g. by giving reduced weight to repeated segments according to their place in the sequence.

References

[1]
R. Bednarik and M. Tukiainen, "An eye-tracking methodology for characterizing program comprehension processes". In Proceedings of the 2006 Symposium on Eye Tracking Research & Applications, pp. 125--132, ACM, New York, NY, USA, 2006, ISBN 1-59593-305-0.
[2]
D. Binkley, M. Davis, D. Lawrie, and C. Morrell, "To camelCase or under_score". In IEEE 17th International Conference on Program Comprehension, pp. 158--167, May 2009.
[3]
B. Cornelissen, A. Zaidman, and A. van Deursen, "A controlled experiment for program comprehension through trace visualization". IEEE Trans. Softw. Eng. 37(3), pp. 341--355, May-June 2011.
[4]
N. E. Fenton and S. L. Pfleeger, Software Metrics: A Rigorous and Practical Approach. Course Technology, 2nd ed., 1998.
[5]
T. Fritz, A. Begel, S. C. M�ller, S. Yigit-Elliott, and M. Z�ger, "Using psycho-physiological measures to assess task difficulty in software development". In Proceedings of the 36th International Conference on Software Engineering, pp. 402--413, ACM, New York, NY, USA, 2014, ISBN 978-1-4503-2756-5.
[6]
E. Granholm, S. K. Morris, A. J. Sarkin, R. F. Asarnow, and D. V. Jeste, "Pupillary responses index overload of working memory resources in schizophrenia". Journal of Abnormal Psychology 106, 1997.
[7]
M. Halstead, Elements of Software Science. Elsevier Science Inc., 1977.
[8]
E. H. Hess, "Attitude and pupil size". Scientific American 212, 1965.
[9]
A. Jbara and D. G. Feitelson, "Quantification of code regularity using preprocessing and compression". Manuscript, Jan 2014.
[10]
A. Jbara and D. G. Feitelson, "On the effect of code regularity on comprehension". In Proceedings of the 22nd International Conference on Program Comprehension, pp. 189--200, ACM, New York, NY, USA, 2014, ISBN 978-1-4503-2879-1.
[11]
A. Jbara, A. Matan, and D. Feitelson, "High-MCC functions in the Linux kernel". Empirical Software Engineering 19(5), pp. 1261--1298, 2014.
[12]
M. Just and P. Carpenter, "A theory of reading: From eye fixations to comprehension". Psychological Review 87, pp. 329--354, 1980.
[13]
M. A. Just and P. A. Carpenter, "The intensity dimension of thought: Pupillometric indices of sentence processing". Canadian Journal of Experimental Psychology 47, 1993.
[14]
J. L. Krein, L. Pratt, A. Swenson, A. MacLean, C. D. Knutson, and D. Eggett, "Design patterns in software maintenance: An experiment replication at Brigham Young University". In 2nd Intl. Workshop Replication in Empirical Software Engineering Research, pp. 25--34, 2011.
[15]
T. McCabe, "A complexity measure". IEEE Trans. Softw. Eng. SE-2(4), pp. 308--320, Dec 1976.
[16]
N. Nagappan, T. Ball, and A. Zeller, "Mining metrics to predict component failures". In 28th Intl. Conf. Softw. Eng., pp. 452--461, May 2006.
[17]
P. Oman and J. Hagemeister, "Construction and testing of polynomials predicting software maintainability". J. Syst. & Softw. 24(3), pp. 251--266, Mar 1994.
[18]
Y. Sasaki, T. Ishihara, K. Hotta, H. Hata, Y. Higo, H. Igaki, and S. Kusumoto, "Preprocessing of metrics measurement based on simplifying program structures". In 19th Asia-Pacific Software Engineering Conference (APSEC), vol. 2, pp. 120--127, 2012.
[19]
J. Shao and Y. Wang, "A new measure of software complexity based on cognitive weights". Canadian J. Electrical and Comput. Eng. 28(2), pp. 69--74, april 2003.
[20]
B. Sharif, M. Falcone, and J. I. Maletic, "An eye-tracking study on the role of scan time in finding source code defects". In Proceedings of the Symposium on Eye Tracking Research and Applications, pp. 381--384, ACM, New York, NY, USA, 2012, ISBN 978-1-4503-1221-9.
[21]
B. Sharif and J. Maletic, "An eye tracking study on camelCase and under_score identifier styles". In IEEE 18th International Conference on Program Comprehension (ICPC), pp. 196--205, June 2010.
[22]
B. Sharif and J. Maletic, "An eye tracking study on the effects of layout in understanding the role of design patterns". In IEEE International Conference on Software Maintenance (ICSM), pp. 1--10, Sept 2010.
[23]
B. Shneiderman, "Measuring computer program quality and comprehension". Intl. J. Man-Machine Studies 9(4), July 1977.
[24]
J. Siegmund, C. K�stner, S. Apel, C. Parnin, A. Bethmann, T. Leich, G. Saake, and A. Brechmann, "Understanding understanding source code with functional magnetic resonance imaging". In Proceedings of the 36th International Conference on Software Engineering, pp. 378--389, ACM, New York, NY, USA, 2014, ISBN 978-1-4503-2756-5.
[25]
E. Soloway and K. Ehrlich, "Empirical studies of programming knowledge". IEEE Trans. Softw. Eng. SE-10(5), pp. 595--609, Sep 1984.
[26]
J. J. Vinju and M. W. Godfrey, "What does control flow really look like? Eyeballing the cyclomatic complexity metric". In 12th Working Conf. Source Code Analysis and Manipulation, Sep 2012.
[27]
H. Wang, M. Chignell, and M. Ishizuka, "Empathic tutoring software agents using real-time eye tracking". In Proceedings of the 2006 Symposium on Eye Tracking Research & Applications, pp. 73--78, ACM, New York, NY, USA, 2006, ISBN 1-59593-305-0.
[28]
K. D. Welker, P. W. Oman, and G. G. Atkinson, "Development and application of an automated source code maintainability index". J. Softw. Maintenance 9(3), pp. 127--159, May 1997.
[29]
E. J. Weyuker, "Evaluating software complexity measures". IEEE Trans. Softw. Eng. 14(9), pp. 1357--1365, Sep 1988.
[30]
S. Yusuf, H. Kagdi, and J. Maletic, "Assessing the comprehension of UML class diagrams via eye tracking". In 15th IEEE International Conference on Program Comprehension, pp. 113--122, June 2007.

Cited By

View all
  • (2018)Data flow metrics in program comprehension tasksProceedings of the Workshop on Eye Movements in Programming10.1145/3216723.3216728(1-6)Online publication date: 15-Jun-2018
  • (2016)The Influence of Syntax Highlighting on Scanning and Reading Behaviour for Source CodeProceedings of the Annual Conference of the South African Institute of Computer Scientists and Information Technologists10.1145/2987491.2987536(1-10)Online publication date: 26-Sep-2016

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
ICPC '15: Proceedings of the 2015 IEEE 23rd International Conference on Program Comprehension
May 2015
325 pages

Sponsors

Publisher

IEEE Press

Publication History

Published: 16 May 2015

Check for updates

Qualifiers

  • Research-article

Conference

ICSE '15
Sponsor:

Upcoming Conference

ICSE 2025

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)7
  • Downloads (Last 6 weeks)0
Reflects downloads up to 19 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2018)Data flow metrics in program comprehension tasksProceedings of the Workshop on Eye Movements in Programming10.1145/3216723.3216728(1-6)Online publication date: 15-Jun-2018
  • (2016)The Influence of Syntax Highlighting on Scanning and Reading Behaviour for Source CodeProceedings of the Annual Conference of the South African Institute of Computer Scientists and Information Technologists10.1145/2987491.2987536(1-10)Online publication date: 26-Sep-2016

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media