摘要
在“人工智能+教育”的教学背景下,针对学生程序设计类作业的反馈工作,提出了一种基于程序依赖图(PDG)的程序代码分类方法。该方法将一组学生程序代码按照求解思路进行自动分类,为教师后续形成有针对性的反馈提供帮助。包括三个关键步骤:首先采用静态分析技术,将源代码生成PDG;然后采用一种基于结构特征的向量表示,将程序表达为特征向量;最后通过k-means聚类算法对一组PDG进行分类。实验对38个求解同一编程问题但实现算法有差异的程序代码开展研究,结果表明了该方法的有效性。
In the light of huge workload for providing targeted feedback to students’programming assignments under the background of“artificial intelligence(AI)+education”teaching,we proposed a program code classification method based on program dependency graph(PDG),which automatically classified a group of student program codes according to algorithm and helped teachers to form targeted feedback in the follow-up.The method included three key steps,firstly,static analysis technology was used to generate PDG from the source code;secondly,a vector representation based on structural features was applied to express the program as a feature vector;finally,a group of PDGs were classified by k-means clustering algorithm.Empirical study of the experiments for 38 program codes which solved the same problem with different implementation algorithms confirmed the effectiveness of the method.
作者
翟晔
刘志国
王春晖
ZHAI Ye;LIU Zhi-guo;WANG Chun-hui(College of Computer Science and Technology,Inner Mongolia NormalUniversity,Hohhot 010022,China;Center of Applied Mathematics,Inner Mongolia NormalUniversity,Hohhot 010022,China)
出处
《内蒙古师范大学学报(自然科学版)》
CAS
2021年第6期513-517,525,共6页
Journal of Inner Mongolia Normal University(Natural Science Edition)
基金
内蒙古自治区自然科学基金资助项目(2021MS06024)
内蒙古师范大学师范专业认证专项重点课题资助项目(2020jxyj045)。