首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到19条相似文献,搜索用时 187 毫秒
1.
为了提高程序题自动评分的准确性,及解决传统评分方法无法从语法结构和语义角度衡量错误的学生程序与正确答案之间的相似度,提出了一种基于抽象语法树匹配的程序题自动评分方法。文中以JavaCC技术为核心,首先通过词法分析、语法分析和语义分析生成错误列表和抽象语法树的中间表示,然后通过语法树切片匹配得分,最后和错误列表结合给出评分结果。文中详细论述了各个模块的设计方法,着重讨论了抽象语法树生成并匹配的细节,设计并实现了一个传统方法与语义分析结合的C++程序题自动评分系统。通过对实际考试的结果进行实验,进而验证了该系统的实用性与有效性。  相似文献   

2.
针对传统的编程题自动评分方法对存在个别语法错误的学生考试程序只能给出零分、不符合卷面笔试时教师手工阅卷习惯的问题,提出了一种适用于有错误的编程题的评分方法,首先,将有语法错误的学生程序分解为基本语句单元,与模板采分点语句一并经过局部语法分析,转化为语法分析树的中间表示,然后进行采分点匹配,进而输出有语法错误的学生程序的评分结果,该方法适用于考察答题者对基本语法知识的正确使用和对题目关键语义的正确表达,使得对有语法错误的学生程序的评分结果更加符合人工阅卷的思想。  相似文献   

3.
针对传统编程题自动评分方法不能准确衡量学生程序与参考答案之间的接近程度等问题,提出了一种基于二元模糊匹配的编程题智能评分方法。第一元为结构匹配,检测学生程序在变量声明、数据输入、函数调用、控制结构等方面与参考答案的相似程度,目的是快速判断学生程序中是否存在关键的采分点。第二元为词语匹配,首先进行词频统计,以确定每个词的权重。然后,分别构造学生程序与参考答案的向量空间模型,并计算两者的余弦相似度,来作为评判词语相似的依据。最终的分数由结构相似度和词语相似度的加权分数计算得出。由于该二元匹配方法不关心程序中结构/词语的先后顺序和是否为精确表达,因此被称为是模糊的。仿真实验表明,该方法具有不错的评分准确性,尽管与人工评分相比还存在一定的差距,但当试题规模较大时,可以作为人工评分的替代手段。  相似文献   

4.
基于面向对象程序的对象间语义级关系,提出了一种对象级粗粒度切片方法,用于解决以往传统程序切片构造过程复杂,切片结构庞大,可理解性不强等问题.该方法并非基于传统的程序依赖图或系统依赖图,而是建立在对象间的关联、组合等语义级关系的基础之上.依据对象间语义级关系构造程序的对象图,在对象图的基础上获取程序的前向对象级粗粒度切片和后向对象级粗粒度切片,并结合了对象间的组合关系使得所得后向对象级粗粒度切片更加精简.  相似文献   

5.
针对现有评测方法结果过于粗糙的问题,提出面向语句分值的C程序静态评分方法.定义答案程序中语句分值的表示形式,引入程序语句依赖图准确表示待判定程序的语法结构;基于语句分值及依赖关系将程序语句依赖图划分为路径片段集合,通过匹配待判定程序和答案程序的路径片段集合相似度获得程序分值.实验结果表明,相比现有评测方法,该方法能够明显提升程序评分的准确度.  相似文献   

6.
一种系统依赖图的面向对象扩充方案   总被引:3,自引:0,他引:3  
提出一种对传统的系统依赖图进行面向对象扩充的方案.把传统的系统依赖图和类依赖子图、类层次子图相结合,从而构成了适合描述面向对象程序的面向对象系统依赖图.详细说明了对系统依赖图进行面向对象语法、语义扩充的过程,同时给出了构造面向对象系统依赖图的一般算法以及应用分析.  相似文献   

7.
所有基于Plan的自动程序理解工具都采用把源码段跟标准Plan库中标准Plan相比较的方法来得到源码语义信息,从而达到程序理解的目标.以程序段的特征信息为索引项,对标准Plan库进行穷尽式快速粗匹配,以克服自下而上程序理解模式搜索强度大,实际应用性不强的弱点,达到快速粗粒度匹配的目标.方法的局限是匹配过程中存在信息遗漏,需要进一步采用模糊推理机制对潜在Plan进行相似性度量.  相似文献   

8.
一个分层切片工具模型   总被引:1,自引:0,他引:1  
谭毅  朱平 《计算机科学》2001,28(12):93-96
程序切片技术在程序调试、测试、程序理解、逆向工程和软件维护等方面有着广泛的应用。程序切片是一组可能影响到在程序中某个点i的某个变量v的值的语句或谓词的集合。而(v,i)被称作切片准则。这里v也可以是一组变量。自从Mark Weiser提出切片的概念,随着程序依赖图、系统依赖图的出现,传统程序的切片技术已走向成熟。1994年以来,面向对象的程序切片逐渐成为研究的主流。A.Krishnaswamy利用一种面向对象的程序依赖图(OPDG,Object-Ori-ented Program Dependence Graph)来计算面向对象程序的语句切片,但是OPDG不能表示动态绑定等问题。D.Liang,L.D.Larsen和M.J.Harrold扩展系统依赖图来计算面向对象程序的切片,在一定程度上解决了动态绑定和对象参数的问题。这些切片方法都是基于依赖图的,而构造OO程序的依赖图是一件非常复杂的工作,而且构造过程中容易出错,这会导致切片的结果不正确,造成前功尽弃。李必信提出了分层切片的思想,利用逐步求精的方法来得到面向对象程序的切片。  相似文献   

9.
钱剑飞  何钦铭  陈华  俞瑞钊 《计算机工程》2007,33(8):163-164,167
所有基于Plan的自动程序理解工具都采用把源码段跟标准Plan相比较的方法来得到源码语义信息。采用程序段的特征信息作为匹配索引项进行粗匹配可以大大加快匹配效率,但完全依赖特征信息作为匹配代理造成了信息流失。该文提出了一种基于模糊推理的细匹配方法来进行相似度分析,目的是对粗匹配得到的潜在Plan集进行相似度分析以得到最终候选Plan集。  相似文献   

10.
程序依赖图往往只能根据语句中变量的定义使用关系来判定数据依赖而无法从语义上精准判断,从而容易引入虚假依赖关系,使得缺陷修复的过程中使用错误信息造成修复失败.因此,本文将利用抽象属性对与空对象或空指针有关的虚假依赖进行剪枝,提出基于抽象语义的程序依赖图减少与程序缺陷语义无关的依赖关系分析,以完成空指针引用修复.依据分析获取的依赖关系,在空指针引用的不同修复策略的指导下实现一种多策略的修复方案,在尽可能减小修复副作用的前提下完成空指针引用缺陷的修复.本文利用Defects4J中的空指针引用对实现的修复工具DTSFix进行实验评估,结果显示DTSFix的修复效果远远高于对比工具,证明了方法的有效性.  相似文献   

11.
An automatic grading approach is presented based on program semantic similarity. Automatic grading of a student program is achieved by calculating semantic similarities between the student program and each correct model program after they are standardized. This approach was implemented in an on-line examination system for the programming language C. Different form other existing approaches, it can evaluate how close a student’s source code is to a correct solution and give a matching accuracy.  相似文献   

12.
Program debugging is an important part of the domain expertise required for intelligent tutoring systems that teach programming languages. This article explores the process by which student programs can be automatically debugged in order to increase the instructional capabilities of these systems. The research presented provides a methodology and implementation for the diagnosis and correction of nontrivial recursive programs. In this approach, recursive programs are debugged by repairing induction proofs in the Boyer-Moore logic. The induction proofs constructed and debugged assert the computational équivalence of student programs to correct exemplar solutions. Exemplar solutions not only specify correct implementations but also provide correct code to replace buggy student code. Bugs in student code are repaired with heuristics that attempt to minimize the scope of repair. The automated debugging of student code is greatly complicated by the tremendous variability that arises in student solutions to nontrivial tasks. This variability can be coped with, and debugging performance improved, by explicit reasoning about computational semantics during the debugging process. This article supports these claims by discussing the design, implementation, and evaluation of Talus, an automatic debugger for LISP programs, and by examining related work in automated program debugging. Talus relies on its abilities to reason about computational semantics to perform algorithm recognition, infer code teleology, and to automatically detect and correct nonsyntactic errors in student programs written in a restricted, but nontrivial, subset of LISP. Solutions can vary significantly in algorithm, functional decomposition, role of variables, data flow, control flow, values returned by functions, LISP primitives used, and identifiers used. Solutions can consist of multiple functions, each containing multiple bugs. Empiricial evaluation demonstrates that Talus achieves high performance in debugging widely varying student solutions to challenging tasks.  相似文献   

13.
学生程序的自动修正是程序设计类大规模网络公开课亟需解决的关键问题。结合学生程序在线评测的需求,提出了基于遗传编程的学生程序修正模型,设计并实现了基于Web的便于教师和学生使用的程序自动修正系统。基于测试用例集实现程序在线评测,对评测结果中满足自动修正条件的学生程序进行错误定位,在此基础上实现自动修正。应用结果表明,该系统可以有效管理、测试学生程序、并为学生修正含有缺陷的程序提供参考,减轻了教师的负担。  相似文献   

14.
A robust technology that automates the diagnosis of students' programs is essential for programming tutoring systems. Such technology should be able to determine whether programs coded by a student are correct. If a student's program is incorrect, the system should be able to pinpoint errors in the program as well as explain and correct the errors. Due to the difficulty of this problem, no existing system performs this task entirely satisfactorily, and this problem still hampers the development of programming tutoring systems. This paper describes a transformation-based approach to automate the diagnosis of students' programs for programming tutoring systems. Improved control-flow analysis and data-flow analysis are used in program analysis. Automatic diagnosis of student programs is achieved by comparing the student program with a specimen program at the semantic level after both are standardized. The approach was implemented and tested on 525 real student programs for nine different programming tasks. Test results show that the method satisfies the requirements stated above. Compared to other existing approaches to automatic diagnosis of student programs, the approach developed here is more rigorous and safer in identifying student programming errors. It is also simpler to make use of in practice. Only specimen programs are needed for the diagnosis of student programs. The techniques of program standardization and program comparison developed here may also be useful for research in the fields of program understanding and software maintenance.  相似文献   

15.
周风顺  王林章  李宣东 《软件学报》2019,30(5):1243-1255
在计算机软件中,程序缺陷不可避免且极有可能造成重大损失.因此,尽早发现并排除程序中潜在的缺陷,是学术界和工业界的普遍共识.目前的程序缺陷自动修复方法大都遵循缺陷定位、修复候选项生成、选择及验证的流程,但在修复实际程序时存在修复率低、无法保证修复结果的正确性等问题.提出了一种基于程序合成的C/C++程序缺陷自动修复方法.首先,从满足相同规约的程序集中,通过人工整理的方式总结错误模式及其对应的修复方法,使用重写规则表达错误模式,在此基础上实现了基于重写规则和基于程序频谱的缺陷定位方法,得到程序中可能的缺陷位置;其次,基于重写规则,使用修复选项生成方法得到缺陷的修复选项,同时,通过深度学习的方式学习正确程序的书写结构,帮助预测错误程序错误点应有的语句结构,通过这两种方式提高候选项质量,进而提高修复率;最后,在选择验证过程中,使用程序合成的方法将样例程序作为约束,保证合成后代码的正确性.基于上述方法实现了原型工具AutoGrader,并在容易出错、缺陷典型的学生作业程序上进行了实验,结果显示,该方法对学生作业程序中的缺陷有着较高的修复率,同时也能保证修复后代码的正确性.  相似文献   

16.
17.
An approach to proving paralel programs correct is presented. The steps are 1) model the paralel program, 2) prove partial correctness (proper synchronization), and 3) prove the absence of deadlock, livelock, and infinite loops. The parallel program model is based on KeUler's model. The main contributions of the paper are techniques for proving the absence of deadlock and livelock. A connection is made between Keler's work and Dijkstra's work with serial non-deterministic programs. It is shown how a variant function may be used to prove finite termination, even if the variant function is not strictly decreasing, and how finite termination can be used to prove the absence of livelock. Handling of the finite delay assumption is also discussed. The illustrative examples indude one which occurred in a commercial environment and a classic synchronization problem solved without the aid of special synchronization primitives.  相似文献   

18.
并行程序Petri网模型的结构性质   总被引:1,自引:0,他引:1  
正确性是并行程序的基础,但是由于它的复杂性,其验证要比串行程序困难得多,因此有必要进行建模并研究其性质.从程序的角度出发,在将基于消息传递的并行程序转换为Petri网模型之后,证明了与并行正确的并行程序对应的Petri网模型应当满足的结构性质,包括强连通性、S-不变量、T-不变量、受控死锁性质以及守恒性,并举例说明了这些性质在并行程序验证中的应用.这些性质可用于并行程序的事前验证,而且避免了使用动态性质进行验证时的状态爆炸问题,从而提高并行程序设计和验证效率.同时这些方法具有良好的可推广性.  相似文献   

19.
James L. Elshoff 《Software》1976,6(4):505-525
A sample of 120 production PL/I programs from several commercial computing installations has been studied. Data about the programs in the sample have been extracted by a PL/I scanning program. The statistical results of the study are presented in this document The paper concentrates on statistical data and not on general conclusions. The data are only interpreted to the extent that it is not ill-defined and misleading. The data profile the use of basic PL/I elements and the structure of programs written in PL/I. The reader of this report will get a better understanding of how PL/I has been used in the commercial environment up to 1974.  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号