Previous works from research and industry have proposed a spatial representation of code in a canvas, arguing that a navigational code space confers developers the freedom to organise elements according to their understanding. By allowing developers to translate logical relatedness into spatial proximity, this code representation could aid in code navigation and comprehension. However, the association between developers' code comprehension and their visuo-spatial mental model of the code is not yet well understood. This mental model is affected on the one hand by the spatial code representation and on the other by the visuo-spatial working memory of developers. We address this knowledge gap by conducting an online experiment with 20 developers following a between-subject design. The control group used a conventional tab-based code visualization, while the experimental group used a code canvas to complete three code comprehension tasks. Furthermore, we measure the participants' visuo-spatial working memory using a Corsi Block test at the end of the tasks. Our results suggest that, overall, neither the spatial representation of code nor the visuo-spatial working memory of developers has a significant impact on comprehension performance. However, we identified significant differences in the time dedicated to different comprehension activities such as navigation, annotation, and UI interactions.
翻译:先前的研究及行业相关工作,提出了在画布中呈现代码的空间表现方式,认为可以帮助开发者根据自身的理解情况组织代码元素,将逻辑相关性转化为空间接近性,从而容易理解和导航代码。然而,开发者的心智视觉空间模型与代码理 解之间的关系仍需进一步探究。这种心智模型既受到空间代码表现方式的影响,也受到开发者的视觉空间工作记忆的影响。为了解决这一问题,我们进行了一项在 20 名开发者间在线实验,采用了两组设计。对照组使用传统的标签式代码可视化,而实验组使用代码画布完成了三个代码理解任务。此外,我们最终使用Corsi方块测验测试了参与者的视觉空间工作记忆。我们的结果表明,总体而言,代码的空间呈现方式和开发者的视觉空间工作记忆都没有对理解表现产生显着影响。但是,我们发现了不同的理解活动,如导航、注释和UI交互等,所需的时间存在显着差异。