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名开发者进行了在线实验。对照组使用传统的基于标签的代码可视化方式,实验组则使用代码画布完成三项代码理解任务。此外,我们在任务结束后通过科西方块测试测量参与者的视觉空间工作记忆。结果表明:总体而言,无论是代码的空间表示还是开发者的视觉空间工作记忆,均未对理解表现产生显著影响。然而,我们在导航、标注和用户界面交互等不同理解活动所花费的时间上发现了显著差异。