摘要
为了培养学习者的程序设计能力,以C程序为测试对象,设计并实现了一种程序在线测试方法。该方法基于开源GCC(GNU Compiler Collection)程序编译器,通过更改进程管道将程序运行结果与测试用例进行比较验证其正确性。对测试程序采用悬停操作提高服务器的CPU并发使用率。运用调试方式加栽程序的途径获取程序运行时间.利用VC工具编写了在线测试的后台实验程序。特别是可执行文件PE代码节的MD5值提取技术解决了源码相似性检测的问题,并实现了文件操作程序的测试。实验结果表明了该方法的有效性和实用性。
In order to train programmaing ability of learner, an online testing method was designed and implemented for testing on C programs. Based on the open source GCC program compiler, the method compared program mn result with test case to prove its correctness b'y rejiggering process pipeline, and adopted hovering operation to improve concurrent use rate of CPU in server. The acquisition of program running time was finished by loading program under debug mode, and the background experiment procedure to online testing was programed with VC. Specially, the MD5 extraction technology of code section based on PE structure solved the problem of approximately detecting of source code, and file operation program testing was also realized. The experiment shows the availabileyd usability of the method.
作者
赵家宇
吴含
彭瑞
ZHAO Jia-yu, WU Han, PENG Rui (1.School of Mechanical Engineering, Shenyang University of Chemical Technology, Shenyang 110142, China; 2.School of Computer Science and Technology, Shenyang University of Chemical Technology, Shenyang 110142, China)
出处
《电脑知识与技术》
2010年第10期8057-8059,共3页
Computer Knowledge and Technology
基金
沈阳化工大学大学生科技创新项目
关键词
C程序
在线测试
源码相似性检测
文件操作程序
C program
online testing
approximately detecting of source code
file operation program