Program visualizations help to form useful mental models of how programs work, and to reason and debug code. But these visualizations exist at a fixed level of abstraction, e.g., line-by-line. In contrast, programmers switch between many levels of abstraction when inspecting program behavior. Based on results from a formative study of hand-designed program visualizations, we designed CrossCode, a web-based program visualization system for JavaScript that leverages structural cues in syntax, control flow, and data flow to aggregate and navigate program execution across multiple levels of abstraction. In an exploratory qualitative study with experts, we found that CrossCode enabled participants to maintain a strong sense of place in program execution, was conducive to explaining program behavior, and helped track changes and updates to the program state.
翻译:程序可视化帮助形成有用的关于程序工作方式的心理模型,并进行推理和调试代码。但是这些可视化存在于固定的抽象级别上,例如逐行级别。相反,程序员检查程序行为时会在多个抽象级别之间切换。基于手工设计的程序可视化的形成性研究结果,我们设计了CrossCode,这是一个基于web的JavaScript程序可视化系统,利用语法,控制流和数据流中的结构提示来聚合和导航多个抽象级别的程序执行。在与专家进行的探索性定性研究中,我们发现CrossCode使参与者保持程序执行中的强烈感,有助于解释程序行为,并有助于跟踪程序状态的修改和更新。