一句话:通过实验发现代码空间表示与视空间工作记忆对程序理解性能无显著影响,但不同理解活动的时间分配有显著差异。
先前研究提出在画布上空间表示代码,认为导航式代码空间能让开发者按自身理解组织元素,通过将逻辑关联转化为空间邻近性来辅助代码导航和理解。然而,开发者的代码理解与其视空间心理模型之间的关联尚不明确,该模型受代码空间表示和视空间工作记忆影响。为此,本文开展了一项在线实验,采用组间设计,20名开发者参与。控制组使用传统标签页式代码可视化,实验组使用代码画布完成三个代码理解任务。任务结束后通过Corsi Block测试测量参与者的视空间工作记忆。结果表明,总体上代码空间表示和视空间工作记忆对理解性能均无显著影响,但在导航、注释和UI交互等不同理解活动上花费的时间存在显著差异。
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.