A Miss is as Good as a Mile: Off-By-One Errors and Arrays in an Introductory Programming Course

被引:6
作者
Rigby, Liam [1 ]
Denny, Paul [1 ]
Luxton-Reilly, Andrew [1 ]
机构
[1] Univ Auckland, Auckland, New Zealand
来源
PROCEEDINGS OF THE TWENTY-SECOND AUSTRALASIAN COMPUTING EDUCATION CONFERENCE, ACE'20 | 2020年
关键词
Off-by-one; CS1; loop error; indexed loops; arrays; logic error;
D O I
10.1145/3373165.3373169
中图分类号
TP301 [理论、方法];
学科分类号
081202 ;
摘要
Loops and arrays are fundamental CS1 concepts, but ones that can be problematic for novice programmers. In this research, we investigate off-by-one errors - logic errors where loops perform one too few or one too many iterations - in code using an indexed loop over an array. We classify off-by-one errors, and explore the prevalence of each type, by analyzing a large set of code submissions from students in a first year programming course as they tackle a sequence of exercises. We describe an approach to reliably identify off-by-one errors through dynamic analysis, and find that off-byone errors are both common and persist across exercises. We also show that students infrequently choose to iterate over an array in reverse, but when they do they more commonly encounter off-byone errors. We conclude that teaching material should explicitly focus student attention on boundary cases, and should provide more examples that iterate through arrays in reverse.
引用
收藏
页码:31 / 38
页数:8
相关论文
共 38 条
[1]  
Ahadi Alireza, 2018, Proceedings of the 20th Australasian Computing Education Conference, P90, DOI [10.1145/3160489.3160490, DOI 10.1145/3160489.3160490]
[2]  
Ahmadzadeh M., 2005, SIGCSE Bulletin, V37, P84, DOI 10.1145/1151954.1067472
[3]   An Empirical Study of Debugging Patterns among Novices Programmers [J].
Alqadi, Basma S. ;
Maletic, Jonathan I. .
PROCEEDINGS OF THE 2017 ACM SIGCSE TECHNICAL SYMPOSIUM ON COMPUTER SCIENCE EDUCATION (SIGCSE'17), 2017, :15-20
[4]  
[Anonymous], 2006, P 2 INT WORKSH COMP, DOI 10.1145/1151588.1151593
[5]  
[Anonymous], 2011, C RES PRACTICE INFOR
[6]   Compiler Error Messages Considered Unhelpful: The Landscape of Text-Based Programming Error Message Research [J].
Becker, Brett A. ;
Denny, Paul ;
Pettit, Raymond ;
Bouchard, Durell ;
Bouvier, Dennis J. ;
Harrington, Brian ;
Kamil, Amir ;
Karkare, Amey ;
McDonald, Chris ;
Osera, Peter-Michael ;
Pearce, Janice L. ;
Prather, James .
PROCEEDINGS OF THE WORKING GROUP REPORTS ON INNOVATION AND TECHNOLOGY IN COMPUTER SCIENCE EDUCATION (ITICSE-WGR '19), 2019, :177-210
[7]   The Effects of Enhanced Compiler Error Messages on a Syntax Error Debugging Test [J].
Becker, Brett A. ;
Goslin, Kyle ;
Glanville, Graham .
SIGCSE'18: PROCEEDINGS OF THE 49TH ACM TECHNICAL SYMPOSIUM ON COMPUTER SCIENCE EDUCATION, 2018, :640-645
[8]   Fix the First, Ignore the Rest: Dealing with Multiple Compiler Error Messages [J].
Becker, Brett A. ;
Murray, Cormac ;
Tao, Tianyi ;
Song, Changheng ;
McCartney, Robert ;
Sanders, Kate .
SIGCSE'18: PROCEEDINGS OF THE 49TH ACM TECHNICAL SYMPOSIUM ON COMPUTER SCIENCE EDUCATION, 2018, :634-639
[9]   Students’ Understanding of Loops and Nested Loops in Computer Programming: An APOS Theory Perspective [J].
Cetin I. .
Canadian Journal of Science, Mathematics and Technology Education, 2015, 15 (2) :155-170
[10]   Identifying Challenging CS1 Concepts in a Large Problem Dataset [J].
Cherenkova, Yuliya ;
Zingaro, Daniel ;
Petersen, Andrew .
PROCEEDINGS OF THE 45TH ACM TECHNICAL SYMPOSIUM ON COMPUTER SCIENCE EDUCATION (SIGCSE'14), 2014, :695-700