Springe zum Hauptinhalt
Softwaretechnik
Softwaretechnik

Understanding Comprehension of Iterative and Recursive Programs with Remote Eye Tracking

 There have been many studies on the teaching and learning of programming styles, including recursion and iteration. Programming styles have been studied from the point of view of mental and conceptual models, program comprehension, common misconceptions, and how to teach them effectively. Recent studies suggest that students tend to understand iterative programs more efficiently than recursive programs. However, there is little empirical evidence as to why this might be the case

  

To create better teaching practices for students, we first have to understand how students understand recursion and iteration. We aim to investigate this phenomenon and identify factors that might drive the understanding of iterative and recursive programs by students.  

We conducted a remote eye-tracking study to record students' visual attention as they were comprehending simple iterative and recursive programs. A total of 117 students participated in the study, and we collected behavioral and visual-attention data.

 We found no clear indication that programming style affects how well and fast students understand iterative and recursive programs. Regarding visual attention, we observed that students follow a comparable reading behavior for both iterative and recursive programs. However, we found different reading behaviors when comparing students who correctly understood programs with students who did not.

In a nutshell, we found that students understood simple recursive and iterative snippets equally well. Even their eye-gaze patterns are very similar. Example of the differences between heat maps generated from recursive(left) vs Iterative(right) responses.

It can be said that for students, there is no difference in efficiency in understanding iterative and recursive algorithms. The visual attention of that same group is equally indistinguishable between top-down and bottom-up comprehension. But it seems that the different programming styles have a different approach to understanding the source code, so other beacons in the code become more relevant and these are visited more often in the course of the comprehension process.

From our data, we made observations that, correct and incorrect solutions seem to result from different eye-gaze patterns. Example of the differences between heat maps generated from correct (left) vs incorrect (right) responses.

To derive more general conclusions, further studies are necessary, for example, with more advanced code (e.g., with mutual recursion) or letting students write code themselves. Measuring the cognitive load (e.g., with pupil dilation) could also provide more rigorous insights into the underlying cognitive process of program comprehension.

Read Paper Here

Contact persons arooba.aqeel@informatik.tu-chemnitz.de