学生程序分析与修复研究
Student Program Analysis and Repair Research
DOI: 10.12677/SEA.2022.113064, PDF,  被引量    科研立项经费支持
作者: 胡建鹏, 魏 龙, 林 渤:上海工程技术大学电子电气工程学院,上海
关键词: 程序修复静态代码分析Cppcheck编辑距离Program Repair Static Code Analysis Cppcheck Edit Distance
摘要: 针对高校C语言程序设计课程教师很难对课堂上每一个学生遇到的问题进行点评,同时课下的编程练习也缺乏对程序错误的指导等问题,设计了一种针对学生程序分析与程序修复的方法。在静态代码分析软件Cppcheck所能检测缺陷类型的基础上,添加了一些学生代码常见的缺陷类型。对于学生程序中出现的语法错误,本文在以往提交的学生代码数据库中,使用编辑距离算法获取修复提示,学生根据修复提示信息对代码进行改正。并基于此方法实现了相关模块应用到C语言在线实验系统,取得了不错的应用效果。
Abstract: Currently, in C language programming courses at colleges and universities, it is difficult for teachers to comment on the problems encountered by each student in the class, and the programming exercises after class also lack guidance on programming errors. To solve these problems, we present a method designed for student program analysis and program repair. Based on the types of errors that can be detected by the static code analysis software Cppcheck, some common types of errors in student code have been added into our work. This paper employs the editing distance algorithm to provide a repair prompt for syntax problems in students’ program, and students correct the code according to the repair prompt. Then, using this method, the relevant module is applied to the C language online experiment system, resulting in a positive application effect.
文章引用:胡建鹏, 魏龙, 林渤. 学生程序分析与修复研究[J]. 软件工程与应用, 2022, 11(3): 602-610. https://doi.org/10.12677/SEA.2022.113064

参考文献

[1] 曾新励. 基于SonarQube平台提升企业软件项目质量的应用研究[J]. 电脑知识与技术, 2019, 15(11): 78-80. [Google Scholar] [CrossRef
[2] 徐海燕, 姜瑛. 基于用户评论的代码质量识别与分析[J]. 计算机科学, 2020, 47(3): 41-47.
[3] 郑炜, 陈军正, 吴潇雪, 陈翔, 夏鑫. 基于深度学习的安全缺陷报告预测方法实证研究[J]. 软件学报, 2020, 31(5): 1294-1313. [Google Scholar] [CrossRef
[4] 王甜甜, 许家欢, 王克朝, 苏小红. 示例演化驱动的学生程序自动修复[J]. 软件学报, 2019, 30(5): 1256-1268. [Google Scholar] [CrossRef
[5] Kim, D., Kwon, Y., Liu, P., et al. (2016) Apex: Automatic Programming Assignment Error Explanation. ACM SIGPLAN Notices, 51, 311-327. [Google Scholar] [CrossRef
[6] Yi, J., Ahmed, U.Z., Karkare, A., Tan, S.H. and Roychoudhury, A. (2017) A Feasibility Study of Using Automated Program Repair for Introductory Programming Assignments. ESEC/FSE 2017: Proceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering, 740-751. [Google Scholar] [CrossRef
[7] Weimer, W., Nguyen, T.V., Le Goues, C. and Forrest, S. (2009) Automatically Finding Patches Using Genetic Programming. 2009 IEEE 31st International Conference on Software Engineering, Vancouver, 16-24 May 2009, 364-374. [Google Scholar] [CrossRef
[8] Long, F. and Rinard, M. (2016) Automatic Patch Generation by Learning Correct Code. ACM SIGPLAN Notices, 51, 298-312. [Google Scholar] [CrossRef
[9] Mechtaev, S., Yi, J. and Roychoudhury, A. (2016) Angelix: Scalable Multiline Program Patch Synthesis via Symbolic Analysis. IEEE/ACM 38th International Conference on Software Engineering (ICSE), Austin, May 2016, 691-701. [Google Scholar] [CrossRef
[10] Weimer, W., Fry, Z.P. and Forrest, S. (2013) Leveraging Program Equivalence for Adaptive Program Repair. 2013 28th IEEE/ACM International Conference on Automated Software Engineering (ASE), Silicon Valley, 11-15 November 2013, 356-366. [Google Scholar] [CrossRef
[11] 林渤, 薛斌, 林逸滔, 胡建鹏. 面向初学者的C语言在线实验系统设计与实现[J]. 智能计算机与应用, 2020, 10(10): 108-111.
[12] 张仕金, 尚赵伟. Cppcheck的软件缺陷模式分析与定位[J]. 计算机工程与应用, 2015, 51(3): 69-73.