C語言編程題在線評(píng)測(cè)系統(tǒng)的設(shè)計(jì)與研究
本文選題:抽象語法樹 + 靜態(tài)分析; 參考:《北京交通大學(xué)》2017年碩士論文
【摘要】:近年來,網(wǎng)絡(luò)在線教學(xué)系統(tǒng)不斷的發(fā)展與推廣,其中針對(duì)程序語言的在線評(píng)測(cè)技術(shù)能夠減輕老師巨大的工作量,同時(shí)給學(xué)習(xí)者的反饋結(jié)果更加準(zhǔn)確及時(shí)。因此該課題逐漸成為了熱門研究領(lǐng)域。目前針對(duì)程序題的評(píng)分策略有動(dòng)態(tài)檢測(cè)方法和靜態(tài)分析方法。其中以動(dòng)態(tài)檢測(cè)為主的系統(tǒng)更傾向于競(jìng)賽模式的Online-Judge,對(duì)于結(jié)果要求嚴(yán)格,對(duì)編程者綜合素質(zhì)要求高,評(píng)測(cè)的關(guān)注點(diǎn)聚焦于算法的結(jié)果和性能。而采用靜態(tài)分析方法的系統(tǒng)則偏向于注重算法邏輯,降低對(duì)結(jié)果實(shí)現(xiàn)的標(biāo)準(zhǔn)。本課題的研究所針對(duì)的使用人群為非計(jì)算機(jī)專業(yè)的學(xué)生與編程愛好者。這類用戶在追求程序結(jié)果準(zhǔn)確的基礎(chǔ)上更多需要考察的是對(duì)題目思考過程的邏輯思維能力與對(duì)程序的理解能力。并且對(duì)于國(guó)內(nèi)高校的教學(xué)而言,充分考慮學(xué)生答題思路,給予步驟分才是合理的考察評(píng)分標(biāo)準(zhǔn)。因此對(duì)程序進(jìn)行合理客觀的評(píng)分是本文想要解決的重點(diǎn)問題,具有理論及現(xiàn)實(shí)的意義。本文將采用動(dòng)態(tài)檢測(cè)與靜態(tài)分析相結(jié)合的方法來完成此次課題的研究,該方案的具體實(shí)現(xiàn)大體上分為兩層處理模式:首先如果程序可執(zhí)行,則進(jìn)入動(dòng)態(tài)檢測(cè),通過測(cè)試用例驅(qū)動(dòng)評(píng)分;其次是當(dāng)程序不可執(zhí)行或是運(yùn)行中出現(xiàn)異常無法運(yùn)行成功時(shí),則進(jìn)入靜態(tài)分析,通過對(duì)程序進(jìn)行基于關(guān)鍵字匹配的知識(shí)點(diǎn)評(píng)分與基于抽象語法樹匹配的程序結(jié)構(gòu)評(píng)分,來綜合獲取得分。在靜態(tài)分析的研究中,本文模擬人工批改的思維模式提出了“知識(shí)點(diǎn)與程序結(jié)構(gòu)相結(jié)合”的綜合評(píng)分方案,該方案首先采用關(guān)鍵詞匹配的相似度計(jì)算方法來解決知識(shí)點(diǎn)評(píng)分的問題,其次,對(duì)程序的語法結(jié)構(gòu)進(jìn)行匹配,采用抽象語法樹為程序轉(zhuǎn)換的中間表示形式,將學(xué)生程序與標(biāo)準(zhǔn)模板程序都轉(zhuǎn)化為這種數(shù)據(jù)載體后,先做消除冗余優(yōu)化處理,之后在基于抽象語法樹的算法上進(jìn)行改進(jìn)實(shí)現(xiàn)程序結(jié)構(gòu)的匹配評(píng)分。最終程序經(jīng)過靜態(tài)分析所得的分?jǐn)?shù)是由知識(shí)點(diǎn)得分與程序結(jié)構(gòu)得分兩者共同決定。本文在調(diào)查研究過現(xiàn)有的在線評(píng)測(cè)系統(tǒng)和代碼設(shè)計(jì)類CAI的基礎(chǔ)上,根據(jù)某院校的真實(shí)教學(xué)需求開發(fā)設(shè)計(jì)并實(shí)現(xiàn)了 C語言編程題在線評(píng)測(cè)系統(tǒng),并將“動(dòng)態(tài)評(píng)測(cè)與靜態(tài)分析相結(jié)合”的方法應(yīng)用到該系統(tǒng)的評(píng)分模塊中。實(shí)驗(yàn)結(jié)果表明:該方法能夠綜合程序的語法結(jié)構(gòu)與語義分析來計(jì)算與模板程序的接近程度,評(píng)分結(jié)果與人工評(píng)閱結(jié)果基本一致。
[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.
【學(xué)位授予單位】:北京交通大學(xué)
【學(xué)位級(jí)別】:碩士
【學(xué)位授予年份】:2017
【分類號(hào)】:TP312.1-4;G434
【參考文獻(xiàn)】
相關(guān)期刊論文 前10條
1 肖崇星;李郴;曹曉灑;;基于代碼相似性算法的敵對(duì)題發(fā)現(xiàn)問題研究[J];無線互聯(lián)科技;2017年01期
2 王力洪;;基于關(guān)鍵字和序列匹配的自動(dòng)評(píng)分算法的研究[J];福建電腦;2015年12期
3 李洪剛;;試論匯編語言與C語言的混合程序設(shè)計(jì)技術(shù)[J];電子世界;2015年18期
4 朱保鋒;宋艷;;一種改進(jìn)的BM算法性能分析[J];中州大學(xué)學(xué)報(bào);2015年03期
5 田冰川;孫珂;巢漢青;;簡(jiǎn)化GCC抽象語法樹的新型算法[J];計(jì)算機(jī)科學(xué);2015年S1期
6 楊超;;基于多種技術(shù)的混合式程序代碼抄襲檢測(cè)方法[J];計(jì)算機(jī)工程與應(yīng)用;2016年18期
7 朱波;鄭虹;孫琳琳;楊友星;;基于AST的程序代碼相似性度量研究[J];吉林大學(xué)學(xué)報(bào)(信息科學(xué)版);2015年01期
8 嚴(yán)大治;;字符串匹配算法比較與分析[J];計(jì)算機(jī)光盤軟件與應(yīng)用;2013年02期
9 鄧愛萍;徐國(guó)梁;肖奔;;程序源代碼剽竊檢測(cè)串匹配算法的研究[J];計(jì)算機(jī)工程與科學(xué);2008年03期
10 郜瑜;;詞法分析及其C語言實(shí)現(xiàn)[J];山西電子技術(shù);2007年03期
相關(guān)博士學(xué)位論文 前1條
1 尹杰;基于編譯器中間語言的軟件運(yùn)行時(shí)可靠性研究[D];清華大學(xué);2015年
相關(guān)碩士學(xué)位論文 前1條
1 佘石泉;編程題自動(dòng)閱卷技術(shù)的研究與實(shí)現(xiàn)[D];中南大學(xué);2007年
,本文編號(hào):1843956
本文鏈接:http://sikaile.net/kejilunwen/ruanjiangongchenglunwen/1843956.html