Concept-Driven Generation of Intuitive Explanations of Program Execution for a Visual Tutor

M. R. Azadmanesh, Matthias Hauswirth
{"title":"Concept-Driven Generation of Intuitive Explanations of Program Execution for a Visual Tutor","authors":"M. R. Azadmanesh, Matthias Hauswirth","doi":"10.1109/VISSOFT.2017.22","DOIUrl":null,"url":null,"abstract":"Learning a programming language is hard. Students need to acquire three types of skills: (1) understand the new language concepts, (2) interpret pieces of code that use those concepts, and (3) write pieces of code involving those concepts. In this paper, we present an approach to help with the second type of skill. There are tools that explain/visualize the execution by stepping through the code. However, such tools suffer from two types of problems. First, the granularity of the stepping is coarse, hiding the intermediate steps in evaluating expressions. Second, for a single statement corresponding to a step of the execution, the order of the evaluation of source code constructs is not aligned with the order the constructs appear in the source code. To fix those, we combine compile-time with run-time information to automatically produce intuitive explanations of code. At compile time, we generate the explanations by traversing the AST. The runtime information provides the execution map and runtime values. We applied our idea to the Java version of Online Python Tutor, a web-based program visualization tool. Each explanation is complemented by highlighting the piece of the source code to which it corresponds, being spoken by the system, and a tree structure visualizing the evaluation of the involved expressions. The fact that the generation of explanations is syntax driven makes the result close to what a human tutor would provide.","PeriodicalId":253313,"journal":{"name":"2017 IEEE Working Conference on Software Visualization (VISSOFT)","volume":"6 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2017-09-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"5","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2017 IEEE Working Conference on Software Visualization (VISSOFT)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/VISSOFT.2017.22","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 5

Abstract

Learning a programming language is hard. Students need to acquire three types of skills: (1) understand the new language concepts, (2) interpret pieces of code that use those concepts, and (3) write pieces of code involving those concepts. In this paper, we present an approach to help with the second type of skill. There are tools that explain/visualize the execution by stepping through the code. However, such tools suffer from two types of problems. First, the granularity of the stepping is coarse, hiding the intermediate steps in evaluating expressions. Second, for a single statement corresponding to a step of the execution, the order of the evaluation of source code constructs is not aligned with the order the constructs appear in the source code. To fix those, we combine compile-time with run-time information to automatically produce intuitive explanations of code. At compile time, we generate the explanations by traversing the AST. The runtime information provides the execution map and runtime values. We applied our idea to the Java version of Online Python Tutor, a web-based program visualization tool. Each explanation is complemented by highlighting the piece of the source code to which it corresponds, being spoken by the system, and a tree structure visualizing the evaluation of the involved expressions. The fact that the generation of explanations is syntax driven makes the result close to what a human tutor would provide.
Visual Tutor程序执行直观解释的概念驱动生成
学习一门编程语言很难。学生需要掌握三种技能:(1)理解新的语言概念,(2)解释使用这些概念的代码片段,(3)编写涉及这些概念的代码片段。在本文中,我们提出了一种方法来帮助第二类技能。有一些工具可以通过逐步执行代码来解释/可视化执行。然而,这类工具存在两类问题。首先,步进的粒度很粗,隐藏了求值表达式中的中间步骤。其次,对于与执行步骤相对应的单个语句,源代码构造的求值顺序与这些构造在源代码中出现的顺序不一致。为了解决这些问题,我们将编译时信息与运行时信息结合起来,自动生成对代码的直观解释。在编译时,我们通过遍历AST生成解释。运行时信息提供了执行映射和运行时值。我们将自己的想法应用到Java版本的在线Python教程中,这是一个基于web的程序可视化工具。每种解释都通过突出显示与之对应的源代码片段(由系统调用)和可视化所涉及表达式的求值的树形结构加以补充。事实上,解释的生成是由语法驱动的,这使得结果接近于人类导师提供的结果。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信