COSTA, José Júnior Silva da.
Abstract:
Reading and understanding code are crucial activities during the software evolution and
maintenance process. However, there are several factors that can affect this understanding,
such as the way the code is structured. Iteration, Recursion and List Comprehension (LC)
are some of these structuring techniques. However, its impact on developers’ performance
has been little investigated from the perspective of visual effort with eye tracking, including
in the context of novices. Therefore, this work aims to conduct a study with eye tracking to
investigate the impact of these different structures on novices’ code understanding. There fore, an initial controlled study was conducted to solve six tasks, using the Latin Square
design with 32 Python novices, measuring time, number of attempts to solve the task and
visual effort through of fixation duration, fixation count and regressions. A comparison was
used with tasks that have the following structures: Recursion, repetition structure and LC.
In the Area of Interest (AOI), regarding the metrics analyzed, increases were observed in the
while, Recursion and LC versions compared to the for version. In the number of regres sions, the increase reached 100% and 114.29% with LC and while, respectively, indicating
the need to return more times in the code. The increase in time reached 95% with while.
Through the analysis of reading patterns, in Recursion, greater focus of attention was noticed
in the base case and in the recursive step. The need for a stop condition and explicit counter
is a hypothesis for the worst performance with while. There were agreements and discrep ancies among participants between performance and perception of difficulty depending on
the task. In general, the for version required less time, attempts and visual effort, indicat ing a better understanding of some tasks. This study mainly contributes to raising awareness
among educators about the impact of Recursion, iteration and LC on code understanding for
Python novices.