How Programmers Read Regular Code: A Controlled Experiment Using Eye Tracking

Ahmad Jbara, Dror G. Feitelson

Research output: Chapter in Book/Report/Conference proceedingConference contribution

14 Scopus citations

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.

Original languageEnglish (US)
Title of host publicationProceedings - 2015 IEEE 23rd International Conference on Program Comprehension, ICPC 2015
PublisherIEEE Computer Society
Pages244-254
Number of pages11
ISBN (Electronic)9781467381598
DOIs
StatePublished - Aug 5 2015
Externally publishedYes
Event23rd IEEE International Conference on Program Comprehension, ICPC 2015 - Florence, Italy
Duration: May 18 2015May 19 2015

Publication series

NameIEEE International Conference on Program Comprehension
Volume2015-August

Conference

Conference23rd IEEE International Conference on Program Comprehension, ICPC 2015
Country/TerritoryItaly
CityFlorence
Period5/18/155/19/15

Keywords

  • Code complexity metrics
  • Code regularity
  • Controlled experiment
  • Eye tracking

ASJC Scopus subject areas

  • Hardware and Architecture
  • Software

Fingerprint

Dive into the research topics of 'How Programmers Read Regular Code: A Controlled Experiment Using Eye Tracking'. Together they form a unique fingerprint.

Cite this