- 无标题文档
查看论文信息

中文题名:

 面向MicroPython程序的自动反馈研究    

姓名:

 查聿翀    

保密级别:

 公开    

论文语种:

 中文    

学科代码:

 081202    

学科专业:

 计算机软件与理论    

学生类型:

 硕士    

学位:

 工学硕士    

学位类型:

 学术学位    

学位年度:

 2020    

校区:

 北京校区培养    

学院:

 教育学部    

研究方向:

 编程教育    

第一导师姓名:

 傅骞    

第一导师单位:

 北京师范大学教育学部    

提交日期:

 2020-06-12    

答辩日期:

 2020-06-12    

外文题名:

 Research towards Automatic Feedback for MicroPython Programs    

中文关键词:

 MicroPython程序 ; 数字表征 ; 自动反馈    

外文关键词:

 MicroPython Program ; digital representation ; automatic feedback    

中文摘要:

随着编程教育的广泛开展,传统的人工反馈方式在大规模开展编程课程时显得力不从心。为解决这一困难,本研究针对中小学编程教育的常见课程——创意电子课程,以创意电子课程常用的MicroPython编程语言为切入点,研究并实现面向该语言程序的自动反馈,自动反馈内容包括学生程序得分和基于错误定位的提示。

为实现面向MicroPython程序的自动反馈,本研究进行了以下工作:

1)优化了基于虚拟机对 MicroPython程序的输入输出进行数字化表征的方法。本研究给出了使得数字化表征的稳定的优化方式,具体包括基于虚拟时钟的运行时机制、降采样机制和随机数改写机制,使得同一程序每次在虚拟机中运行的输出结果完全相同,解决了数字表征结果不稳定的问题。同时,在此基础上实现了基于MixGo开发板的MicroPython程序输入输出数字化表征,从而为后续自动反馈建立了基础。

2)实现了对MicroPython程序的自动反馈。自动反馈包含两部分内容,一是程序评分,二是出错程序中可能存在错误的程序实体。对于程序评分,本研究利用程序自动评价的动态执行方法,给出了判断程序正确性的算法,对于算法判断正确的程序,给满分;对于算法判断有错的程序,通过时间弯曲编辑距离算法计算其与正确程序数字化表征结果的相似度,给予合理的分数。然后,通过实验在收集到的903个程序上对比了人工判别评分与自动评分结果,验证了自动评分的有效性。对于出错程序,本研究利用软件工程领域的错误定位方法,发现程序可能存在的错误实体,将这些错误实体作为提示报告给用户。本文提出的错误定位方法结合了基于程序谱的方法和静态分析方法:首先利用插桩法记录程序执行路径,结合程序自动测评结果获取程序中的错误执行路径;接下来利用树编辑距离算法,从多份正确代码生成的对应代码片段中找到与错误执行路径最近似的个体;最后对比错误执行路径与最近似的对应代码片段,找出程序中可能导致错误的程序实体,作为反馈内容报告给用户。对比过程分为两步,第一步使用树的最大匹配发现错误执行路径与最近似的对应代码片段的语句级别差异;如果不存在语句级别差异,再对表达式中的变量进行匹配处理,使用类似于程序的动态执行方法比较表达式级别的差异。本研究同样在收集到的903个程序上验证了这种基于错误定位的自动反馈方法,共生成4619条反馈内容,具有较高准确率。

最后,基于上述研究成果,本研究实现了一个创意电子课程任务系统。系统具有发布任务、在线编程、模拟执行、自动测评与反馈等功能,可以较好支持基于MicroPython的创意电子课程教学。

本研究利用程序自动测评、程序错误定位等研究领域的相关成果,探索了对编程作业进行自动反馈的前沿研究问题,为利用自动化手段大规模开设在线编程课程提供了助力。
外文摘要:

With the popularization of programming in K-12 education, manual feedback method seems to be inefficient facing with large number of students. In order to solve this problem, this study focuses on a popular programming course in elementary and middle schools: Creative electronic courses based on MicroPython, and chooses MicroPython as the programming language to be studied and implement automatic feedback for programs in it. The content of automatic feedback includes grading students’ program and providing suggestions for programs with fault.

In order to implement automatic feedback for MicroPython programs, the following work was performed in this research:

Firstly, this study optimizes the method for digitally characterizing MicroPython program’s input/output by running MicroPython programs in the virtual machine. This study gives a stable optimization method for the digital characterization of MicroPython program’s input/output, including the runtime mechanism based on the virtual clock, the down-sampling mechanism and the random number rewriting mechanism. At the follow section of this chapter, this study realized a digital characterization for MicroPython program input/output based on the MixGo, a single-chip machine which can run MicroPython programs. This work establishes the foundation for subsequent work.

Secondly, based on the digital characterization of MicroPython program’s input/output, this study implements the automatic feedback for MicroPython programs. The automatic feedback contains two parts, one is to grade the program, and the other is to locate the fault of the wrong program. In order to grade the program, this study gives an algorithm to judge the correctness of the MicroPython program taking advantage of the dynamic execution method. For the correct programs, giving them full score. For the wrong programs, this study calculates the similarity of the digital characterizations of the wrong program and the correct program through the Time-Warping Edit Distance algorithm so that providing a reasonable score to the wrong program. Afterward, this study compares the result of manual evaluation and the result of automatic evaluation algorithm in an experiment to verify the effectiveness of the grading method. The result of experiment on 903 programs shows that the grading method is effective. After the automatic evaluation, to offer more tips for the programs with fault, this study uses fault localization method in software engineering to find the entities in the program which possibly cause bugs, and report them to the user as the second part of feedback content. The fault localization method uses in this study combines the method based on program spectrum and the static analysis method: First, program-instrumentation method is used to record the program execution path, and the error execution path in the wrong program is obtained based on the results of the automatic evaluation algorithm. Next, the Tree Edit Distance algorithm is adopted to find the one which is the most similar to the code fragments of the wrong execution path from the corresponding code fragments generated by multiple kind of the correct code. Finally, the two code fragments are compared to find out the entities that may cause the bugs in the program with fault. The comparison process can be divided into two steps. In the first step, the comparison process finding the statement-level difference between the two code segments via tree mapping algorithm. If there is no statement-level difference, then do the second step: matching the variables in the expression, and then comparing the differences between the expressions using a method similar to the dynamic execution of the program. At the last section of this chapter, this study also verifies the automatic feedback method on the dataset of 903 programs. A total of 4619 pieces of feedback content are generated with high accuracy.

Lastly, based on the research above, this study implements a system for teaching programming in MicroPython language. The functions of the system include publishing tasks, online programming, simulation execution, automatic evaluation and automatic feedback. Multiple optimization is adopted to increase the system's performance. Overall, this system can support programming course in MicroPython language better.

This thesis explores the cutting-edge research issues of automatic feedback for programming courses by using techniques in related research areas such as automatic program evaluation and program fault localization. Moreover, the achievement of this research is able to help educational practice like providing online MicroPython programming courses on a large scale.

参考文献总数:

 68    

作者简介:

 查聿翀同学系我校教育学部2017级计算机软件与理论专业学术型硕士研究生,在校期间按规定完成了培养方案所有必修内容,毕业所需学分35分,实际修读学分45分,中期考核成绩为优秀。在读期间参与了佛山市禅城区创客教育区域推进策略等多项科研项目,以第三作者身份发表CSSCI核心期刊论文一篇,以第一作者身份在AECT2018年会发表英文会议论文一篇,取得软件著作权两项(著作权登记人为北京师范大学)。研究生在读期间,查聿翀同学科研态度扎实认真,基本掌握了基本研究方法,具有一定软件开发能力,已具备在导师指导下独立开展科学研究的能力。自2019年12月开题以来,查聿翀同学对论文选题MicroPython程序的自动反馈展开了深入研究,多方查阅文献和相关产品资料,实地拜访了相关领域知名学者,毕业论文撰写符合学术规范,具有足够的工作量和一定创新性。    

馆藏号:

 硕081202/20009    

开放日期:

 2021-06-12    

无标题文档

   建议浏览器: 谷歌 360请用极速模式,双核浏览器请用极速模式