Dereferee: Exploring pointer mismanagement in student code

被引:8
作者
Department of Computer Science, State University, Torgersen Hall, Blacksburg, VA 24061, United States [1 ]
机构
[1] Department of Computer Science, State University, Torgersen Hall, Blacksburg
来源
SIGCSE Bull. Inroads | 2009年 / 1卷 / 173-177期
关键词
Dangling pointer; dynamic memory management; memory leak; null dereference; pointer checking; programming assignment; smart pointer; tdd; test-driven development; test-first coding;
D O I
10.1145/1539024.1508928
中图分类号
学科分类号
摘要
Dynamic memory management and the use of pointers are critical topics in teaching the C++ language. They are also some of the most difficult for students to grasp properly. The responsibility of ensuring that students understand these concepts does not end with the instructor's lectures - -a library enhanced with diagnostics beyond those provided by the language's run-time system itself is a useful tool for giving students more detailed information when their code fails. We have designed such a toolkit, Dereferee, which students can incorporate into their code with minimal intrusion into the learning process. To demonstrate its effectiveness, we examine C++ code from students in a course that relied solely on the built-in memory management behavior of the language, without any significant additional diagnostic or debugging facilities. We instrument this code with Dereferee in order to explore the causes of errors that result in program crashes and to expose hidden faults that previously lay undetected. Dereferee provided enhanced diagnostics for bugs in 63% of student submissions, and pinpointed the source of 83% of abnormal program terminations. 95% of the students would have received extra diagnostic help from using Dereferee.
引用
收藏
页码:173 / 177
页数:4
相关论文
共 7 条
[1]  
Boost
[2]  
CxxTest
[3]  
Edwards S.H., Improving student performance by evaluating how well students test their own programs, J. Educational Resources in Computing, 3, 3, pp. 1-24, (2003)
[4]  
Edwards S.H., Using software testing to move students from trial-and-error to reflection-in-action, SIGCSE Tech. Symp. Computing Science Education, pp. 26-30, (2004)
[5]  
Lahtinen E., Ala-Mutka K., Jarvinen H.M., A study of the difficulties of novice programmers, Ann. SIGCSE Conf. Innovation and Tech. in Computer Science Education, pp. 14-18, (2005)
[6]  
Milne I., Rowe G., Difficulties in learning and teaching programming - views of students and tutors, Education and Information Technologies, 7, 1, pp. 55-66, (2002)
[7]  
Pike S.M., Weide B.W., Hollingsworth J.E., Checkmate: Cornering C++ dynamic memory errors with checked pointers, SIGCSE Tech. Symp. Computer Science Education, pp. 352-356, (2000)