作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2024, Vol. 50 ›› Issue (9): 197-207. doi: 10.19678/j.issn.1000-3428.0068265

• 体系结构与软件技术 • 上一篇    下一篇

程序调试中的数据结构演变可视化方法

苏庆, 陈建成, 顾国生*(), 刘冬宁, 黄剑锋   

  1. 广东工业大学计算机学院, 广东 广州 510006
  • 收稿日期:2023-08-21 出版日期:2024-09-15 发布日期:2024-04-01
  • 通讯作者: 顾国生
  • 基金资助:
    国家自然科学基金(62072120); 广东工业大学教育教学改革项目(广工大教字〔2023〕51号); 广东工业大学“本科教学工程”项目(广工大教字〔2024〕75号)

Visualization Method for Data Structure Evolution in Program Debugging

SU Qing, CHEN Jiancheng, GU Guosheng*(), LIU Dongning, HUANG Jianfeng   

  1. School of Computer Science and Technology, Guangdong University of Technology, Guangzhou 510006, Guangdong, China
  • Received:2023-08-21 Online:2024-09-15 Published:2024-04-01
  • Contact: GU Guosheng

摘要:

数据结构是程序执行时的重要信息载体, 其演变过程往往较为复杂和抽象。针对程序设计初学者较难理解数据结构演变过程的问题, 提出一种面向程序调试中的数据结构演变可视化方法。在调试开始时, 首先使用组件表达式表示数据结构, 然后通过配置表以及布局函数将组件表达式生成可视化视图。在进行单步调试后, 通过对比单步调试前后的可视化数据方式生成组件演变行为, 运用有限状态机理论构建数据结构演变模型, 该模型的执行使得组件发生演变, 同时生成可视化动作。使用动画单元执行可视化动作, 实现数据结构演变的可视化呈现, 帮助初学者理解数据结构相关程序的执行过程。实验结果表明, 将该方法应用于1个数据结构演变可视化框架StructV, 并应用于1个在线可视化编程实训云平台的研发, 可有效降低初学者理解数据结构演变过程的难度, 并提升编程实训时的程序调试效率。

关键词: 程序调试, 数据结构可视化, 组件演变行为, 有限状态机, 数据结构演变模型

Abstract:

Data structure carries important information regarding program execution in complicated and abstract evolution processes. To address the difficulty encountered by beginners in understanding the evolution process of data structures, this study proposes a method for visualizing the data structure evolution in program debugging. Initially, during debugging, the data structures are represented using component expressions. Subsequently, visual views are generated using configuration tables and layout functions based on component expressions. After single-step debugging, the evolution behavior of the components is determined by comparing the visual data before and after single-step debugging. A data structure evolution model is constructed using the finite state machine theory. The execution of this model causes the components to evolve while generating visual actions. This model uses animation units to perform visual actions and visualize the evolution of data structures, helping beginners understand the execution process of data structure-related programs. The experimental results of applying this method to a data structure evolution visualization framework, StructV, and to the development of an online visualization programming training cloud platform show that this process can effectively reduce the difficulty encountered by beginners in understanding data structure evolution and improve the efficiency of program debugging during programming training.

Key words: program debugging, data structure visualization, component evolution behavior, finite state machine, data structure evolution model