Common Logic Errors for Programming Learners: A Three-decade Literature Survey
Nabeel Alzahrani, Frank Vahid · 2021 ASEE Virtual Annual Conference Content Access Proceedings · 2021
We surveyed common logic errors made by students learning programming in introductory (CS1) programming classes, as reported in 47 publications from 1985 to 2018.A logic error causes incorrect program execution, in contrast to a syntax error, which prevents execution.Logic errors tend to be harder to detect and fix and are more likely to cause students to struggle.The publications described 166 common logic errors, which we classified into 11 error categories: input (2 errors), output (1 error), variable (7 errors), computation (21 errors), condition (18 errors), branch (14 errors), loop (27 errors), array (5 errors), function (24 errors), conceptual (43 errors), and miscellaneous (4 errors).Among those errors, we highlighted 43 that seemed to be the most common and/or troublesome.As interest in computer science education continues to grow, with college majors tripling in the past decade, this survey can help instructors, authors, and tool developers focus on helping learners detect or avoid these common errors in CS1.