C语言编程题在线评测系统的设计与研究
发布时间:2018-05-04 17:39
本文选题:抽象语法树 + 静态分析 ; 参考:《北京交通大学》2017年硕士论文
【摘要】:近年来,网络在线教学系统不断的发展与推广,其中针对程序语言的在线评测技术能够减轻老师巨大的工作量,同时给学习者的反馈结果更加准确及时。因此该课题逐渐成为了热门研究领域。目前针对程序题的评分策略有动态检测方法和静态分析方法。其中以动态检测为主的系统更倾向于竞赛模式的Online-Judge,对于结果要求严格,对编程者综合素质要求高,评测的关注点聚焦于算法的结果和性能。而采用静态分析方法的系统则偏向于注重算法逻辑,降低对结果实现的标准。本课题的研究所针对的使用人群为非计算机专业的学生与编程爱好者。这类用户在追求程序结果准确的基础上更多需要考察的是对题目思考过程的逻辑思维能力与对程序的理解能力。并且对于国内高校的教学而言,充分考虑学生答题思路,给予步骤分才是合理的考察评分标准。因此对程序进行合理客观的评分是本文想要解决的重点问题,具有理论及现实的意义。本文将采用动态检测与静态分析相结合的方法来完成此次课题的研究,该方案的具体实现大体上分为两层处理模式:首先如果程序可执行,则进入动态检测,通过测试用例驱动评分;其次是当程序不可执行或是运行中出现异常无法运行成功时,则进入静态分析,通过对程序进行基于关键字匹配的知识点评分与基于抽象语法树匹配的程序结构评分,来综合获取得分。在静态分析的研究中,本文模拟人工批改的思维模式提出了“知识点与程序结构相结合”的综合评分方案,该方案首先采用关键词匹配的相似度计算方法来解决知识点评分的问题,其次,对程序的语法结构进行匹配,采用抽象语法树为程序转换的中间表示形式,将学生程序与标准模板程序都转化为这种数据载体后,先做消除冗余优化处理,之后在基于抽象语法树的算法上进行改进实现程序结构的匹配评分。最终程序经过静态分析所得的分数是由知识点得分与程序结构得分两者共同决定。本文在调查研究过现有的在线评测系统和代码设计类CAI的基础上,根据某院校的真实教学需求开发设计并实现了 C语言编程题在线评测系统,并将“动态评测与静态分析相结合”的方法应用到该系统的评分模块中。实验结果表明:该方法能够综合程序的语法结构与语义分析来计算与模板程序的接近程度,评分结果与人工评阅结果基本一致。
[Abstract]:In recent years, the network online teaching system has been developing and popularizing. The online evaluation technology for program language can reduce the huge workload of teachers and give learners more accurate and timely feedback. Therefore, the subject has gradually become a hot research field. At present, there are dynamic detection methods and static analysis methods for the scoring strategies of program problems. The system based on dynamic detection is more inclined to contest Online-Judge.It requires strict results and high quality of programmers. The focus of evaluation is focused on the results and performance of the algorithm. The static analysis system tends to pay attention to the algorithm logic and reduce the standard of the result realization. This study aims at non-computer major students and programming enthusiasts. On the basis of the accuracy of the program, this kind of user needs to investigate the logical thinking ability and the understanding ability of the program. And for the teaching of colleges and universities in China, it is reasonable to consider the students' thinking of answering questions and give them step points. Therefore, the reasonable and objective evaluation of the procedure is the key problem to be solved in this paper, which has theoretical and practical significance. This paper will adopt the method of combining dynamic detection and static analysis to complete the research of this subject. The concrete implementation of this scheme is divided into two layers: first, if the program can be executed, then it can enter the dynamic detection. The test case driven score is followed by static analysis when the program is not executable or when an exception does not work. The score is obtained by scoring the knowledge points based on keyword matching and the program structure score based on abstract syntax tree matching. In the study of static analysis, this paper puts forward a comprehensive scoring scheme of "combination of knowledge points and program structure", which simulates the thinking mode of manual correction. Firstly, the method of calculating the similarity of keyword matching is used to solve the problem of the score of knowledge points. Secondly, the syntax structure of the program is matched, and the abstract syntax tree is used as the intermediate representation of the transformation of the program. After the student program and the standard template program are transformed into this kind of data carrier, the redundant optimization is eliminated first, and then the matching score of the program structure is improved on the algorithm based on abstract syntax tree. The score of the final program through static analysis is determined by both the knowledge point score and the program structure score. Based on the investigation and research of the existing online evaluation system and the code design class CAI, this paper designs and implements the online evaluation system of C language programming questions according to the real teaching requirements of a certain college. The method of combining dynamic evaluation with static analysis is applied to the scoring module of the system. The experimental results show that this method can integrate the syntax structure and semantic analysis of the program to calculate the close degree to the template program, and the score results are basically consistent with the manual evaluation results.
【学位授予单位】:北京交通大学
【学位级别】:硕士
【学位授予年份】:2017
【分类号】:TP312.1-4;G434
【参考文献】
相关期刊论文 前10条
1 肖崇星;李郴;曹晓洒;;基于代码相似性算法的敌对题发现问题研究[J];无线互联科技;2017年01期
2 王力洪;;基于关键字和序列匹配的自动评分算法的研究[J];福建电脑;2015年12期
3 李洪刚;;试论汇编语言与C语言的混合程序设计技术[J];电子世界;2015年18期
4 朱保锋;宋艳;;一种改进的BM算法性能分析[J];中州大学学报;2015年03期
5 田冰川;孙珂;巢汉青;;简化GCC抽象语法树的新型算法[J];计算机科学;2015年S1期
6 杨超;;基于多种技术的混合式程序代码抄袭检测方法[J];计算机工程与应用;2016年18期
7 朱波;郑虹;孙琳琳;杨友星;;基于AST的程序代码相似性度量研究[J];吉林大学学报(信息科学版);2015年01期
8 严大治;;字符串匹配算法比较与分析[J];计算机光盘软件与应用;2013年02期
9 邓爱萍;徐国梁;肖奔;;程序源代码剽窃检测串匹配算法的研究[J];计算机工程与科学;2008年03期
10 郜瑜;;词法分析及其C语言实现[J];山西电子技术;2007年03期
相关博士学位论文 前1条
1 尹杰;基于编译器中间语言的软件运行时可靠性研究[D];清华大学;2015年
相关硕士学位论文 前1条
1 佘石泉;编程题自动阅卷技术的研究与实现[D];中南大学;2007年
,本文编号:1843956
本文链接:https://www.wllwen.com/kejilunwen/ruanjiangongchenglunwen/1843956.html