Explain Trace: Misconceptions of Control-Flow Statements
Abstract
:1. Introduction
- RQ1. What undergraduate students’ misconceptions of control-flow statements can be identified by interpreting a single line of trace?
- RQ2. How do these misconceptions relate to the misconceptions known in the literature?
2. Related Work
2.1. Methods of Studying Misconceptions
2.1.1. Interview
2.1.2. Analysis of Code Written by Students
2.1.3. Result-Prediction Problems
2.1.4. Code-Tracing Problems
2.1.5. Combined Methods
2.2. Misconceptions Related to Flow of Control
- “spurious/missing text/code fragment”;
- “missing condition” (it is unclear whether it applies only to loops or to “if-else” as well);
- “missing loop”;
- “order of conditions”;
- “code outside of function block”;
- “infinite loop”.
- 23-Ctrl “Difficulties in understanding the sequentiality of statements”;
- 24-Ctrl “Code after ‘if’ statement is not executed if the ‘then’ clause is.”;
- 26-Ctrl “A false condition ends program if no ‘else’ branch exists”;
- 27-Ctrl “Both ‘then’ and ‘else’ branches are executed”;
- 28-Ctrl “The ‘then’ branch is always executed”;
- 30-Ctrl “Adjacent code executes within loop”;
- 31-Ctrl “Control goes back to start when a condition is false”;
- 33-Ctrl “Loops terminate as soon as condition changes to false” (interrupting iteration/ skipping the rest of iteration).
3. Method
3.1. Data Collection
3.2. Data Analysis
4. Results
- 3 misconceptions about sequences (SEQ*),
- 10 misconceptions about selection statements (SEL*);
- 8 misconceptions about loops (LOOP*);
- 1 misconception about concept recognition (RECsl);
- 2 misconceptions about notation (NOT*) or used terms.
- SEL2 is effectively the same as “UI2: Failing to jump upon selection” [14];
- SEL3 matches “e26: order of conditions” [15];
- SEL6 is a generalized form of “27-Ctrl: Both then and else branches are executed” reported by [5];
- LOOP3 is a sub-type of “30-Ctrl: Adjacent code executes within loop” reported by [5];
- LOOP4 is close to “Extra Count” (an extra iteration) by [7].
- LOOP5 is a more general misconception than “Missing 0” (skipping the first iteration) by [7].
- SEL4, SEL10 are specific to “think aloud”/“write what you think” methods and unlikely to be found by other methods;
- LOOP6, LOOP7, LOOP8 are detectable by the “simulate execution” method too, but they are about “for” and “foreach” loops which received less attention from other researchers than “while” and “do–while” loops;
- SEL7 and SEL8 are only detectable if the researcher asks the students about the beginning and ending of each control-flow statement during execution, not just about executed lines, which was done rarely in the previous literature;
- SEL5, SEL9 can be detected by using the “simulate execution” method, but they were not reported in the literature (to the best of our knowledge); one possible explanation is the low number of tasks using selection statements with multiple branches that are required for detecting SEL5 and increase the possibility of detecting SEL9.
5. Discussion
- RQ1. What undergraduate students’ misconceptions of control-flow statements can be identified by interpreting a single line of trace?
- Not considering the truth of a control condition as the cause for the execution of its branch—demonstrated by 10 students out of 67 participants;
- Conditions of a selection statement are checked in the wrong order—demonstrated by 9 students;
- A “for” loop is initialized after its iteration—demonstrated by 8 students;
- Calling the selection statement a loop—demonstrated by 8 students;
- Failing to take into account the end of a block—demonstrated by 7 students;
- Starting a ‘then’ branch after a false condition—demonstrated by 7 students;
- Skipping the update step of a “for” or “foreach” loop—demonstrated by 7 students;
- Two or more branches of one selection statement are executed—demonstrated by 6 students;
- Action, which is placed after the selection, is considered belonging to its branch—demonstrated by 6 students;
- Continuing a loop after its control condition evaluates to false—demonstrated by 6 students;
- Action, which is placed after a loop, is considered belonging to the loop—demonstrated by 6 students.
- RQ2. How do these misconceptions relate to the misconceptions known in the literature?
- Not considering the truth of a control condition as the cause for the execution of its branch;
- Checking a condition after executing a branch;
- Action, which is placed after the selection, is considered belonging to its branch;
- Exiting a selection without executing a branch or checking all the conditions;
- Multiple checks of the same condition in one selection statement;
- Executing a wrong branch after checking a condition;
- A “for” loop is initialized after its iteration;
- Skipping the update step of a “for” or “foreach” loop;
- Skipping the initialization of a “for” loop;
- Calling the selection statement a loop;
- Calling the program a loop.
6. Threats to Validity
7. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
Abbreviations
CS | Computer science |
IDE | Integrated Developer Environment |
SE | Software engineering |
Appendix A. Misconceptions and Responses Labeling
Label | Misconception | Count of Students |
---|---|---|
SEQ1 | Failing to take into account the end of a block: The student thinks that a block or function has not been completed, although it has ended. | 7 |
SEQ2 | Action, which is placed after a sequence, is executed inside the sequence: Inside the block, the student executes an action that is placed after the block. | 3 |
SEQ3 | Actions are executed in the wrong order: The student executes actions inside a block in a different order than they are placed in the sequence. | 1 |
SEL1 | A “then” branch is always executed: The student thinks that a selection-statement branch can be executed without evaluating its condition first. | 3 |
SEL2 | Starting a “then” branch after a false condition: The student tries to start a selection-statement branch even though its condition is false. | 7 |
SEL3 | Conditions of a selection statement are checked in the wrong order: The student thinks that, in a multi-branch selection statement, conditions can be checked not in the order they are placed in the statement | 9 |
SEL4 | Not considering the truth of a control condition as the cause for the execution of its branch: When asked why a branch of the selection statement has started, the student does not mention the value of its control condition as the reason for its execution. | 10 |
SEL5 | Checking a condition after executing a branch: The student thinks that a condition can be evaluated after the corresponding branch of the selection statement is completed. | 5 |
SEL6 | Two or more branches of one selection statement are executed: The student thinks that more than one branch can be executed during one execution of a selection statement. | 6 |
SEL7 | Action, which is placed after the selection, is considered belonging to its branch: Inside a selection-statement branch, the student executes an action that is placed after the selection statement. | 6 |
SEL8 | Exiting a selection without executing a branch or checking all the conditions: The student thinks that a selection statement can finish before checking all its conditions and/or without executing a branch whose condition is true. | 2 |
SEL9 | Multiple checks of the same condition: The student thinks that in a selection statement, a branch condition can be evaluated several times. | 4 |
SEL10 | Executing a wrong branch after checking a condition: The student thinks that a different branch can be executed after a selection-statement condition evaluates to true. | 3 |
LOOP1 | Missing first condition test in a precondition loop: The student thinks that the first iteration of a precondition loop can begin without evaluating the loop condition first. | 4 |
LOOP2 | Continuing a loop without checking its condition: The student thinks that the next iteration of a loop can begin without evaluating the loop condition after the end of the previous iteration. | 4 |
LOOP3 | Continuing a loop after its control condition evaluates to false: The student thinks that a loop iteration can begin if the loop condition is false (for “while”, “do-while” and “for” loops). | 6 |
LOOP4 | Action, which is placed after a loop, is considered belonging to the loop: Inside the body of a loop, the student executes an action that is placed after the loop. | 6 |
LOOP5 | Skipping an iteration when the loop condition is true: The student thinks that the computer can proceed to the next action of the loop (e.g., checking the condition again) without executing the loop’s iteration. | 5 |
LOOP6 | A “for” loop is initialized after its iteration: The student thinks that the initialization step of a “for” loop can be executed after the iteration finishes. | 8 |
LOOP7 | Skipping the update step of a “for” or “foreach” loop: The student thinks that the update step of a “for” or “foreach” can be omitted after an iteration finishes. | 7 |
LOOP8 | Skipping the initialization of a “for” loop: The student thinks that the initialization step of a “for” loop should not be executed when the loop starts. | 5 |
RECsl | Perceiving a selection statement as iterative: The student thinks that a selection statement can have several iterations during a single execution of the statement. | 1 |
NOT1sl | Calling the selection statement a loop: When explaining the behavior of the selection statement, the student calls it a loop. | 8 |
NOT2pl | Calling the program a loop: When explaining the behavior of the program, the student calls it a loop. | 3 |
Misconception Assigned | Question Description | Answer Template | Correct Answer | Student’s Answer |
---|---|---|---|---|
SEL1 (q. #139) | A loop having a selection with the target act iterates two times. | The act “well_done” occurs exactly twice in the trace, because… | both times when the selection statement was executed in the loop, its condition evaluated to true. | the action must be performed once in each iteration, so there are two iterations. |
SEL4 (q. #8) | A branch’s condition has been evaluated to true, and the branch started | The branch should begin here because… | its condition evaluates to true. | it stands after checking the condition. |
SEL5 (q. #31) | A branch’s condition has been evaluated to false and evaluated again. | The condition “now_green” is wrong in this place, because… | the selection should check the conditions one by one. | the “else” branch should have been executed first, and only then the condition should be checked. |
SEL9 (q. #30) | A branch’s condition has been evaluated to false and is evaluated again. | The condition “now_red” is wrong in this place, because… | the selection should check its condition only once. | it must appear before the previous condition. |
LOOP4 (q. #168) | Action “go” stands after the end of a “while” loop; the loop tries to end without evaluating its condition. | The end of the loop is wrong in this place, because… | the condition of the loop must be evaluated first. | it should end after the “go” act. |
LOOP6 (q. #178) | A “for” loop’s iteration begins without checking its condition. | The iteration should not begin here because… | the condition of the loop has not been evaluated. | 2nd initialization was not performed. |
References
- Luxton-Reilly, A.; Simon; Albluwi, I.; Becker, B.A.; Giannakos, M.; Kumar, A.N.; Ott, L.; Paterson, J.; Scott, M.J.; Sheard, J.; et al. Introductory Programming: A Systematic Literature Review. In Proceedings of the 23rd Annual ACM Conference on Innovation and Technology in Computer Science Education, ITiCSE 2018 Companion, Larnaca, Cyprus, 2–4 July 2018; pp. 55–106. [Google Scholar] [CrossRef]
- Shi, N. Improving Undergraduate Novice Programmer Comprehension through Case-Based Teaching with Roles of Variables to Provide Scaffolding. Information 2021, 12, 424. [Google Scholar] [CrossRef]
- Murphy, L.; Fitzgerald, S.; Lister, R.; McCauley, R. Ability to ‘explain in Plain English’ Linked to Proficiency in Computer-Based Programming. In Proceedings of the Ninth Annual International Conference on International Computing Education Research, ICER ’12, Auckland, New Zealand, 9–11 September 2012; pp. 111–118. [Google Scholar] [CrossRef]
- Pea, R.D. Language-Independent Conceptual “Bugs” in Novice Programming. J. Educ. Comput. Res. 1986, 2, 25–36. [Google Scholar] [CrossRef]
- Sorva, J. Visual Program Simulation in Introductory Programming Education. Ph.D. Thesis, Aalto University, Espoo, Finland, 2012. [Google Scholar]
- Sekiya, T.; Yamaguchi, K. Tracing Quiz Set to Identify Novices’ Programming Misconceptions. In Proceedings of the 13th Koli Calling International Conference on Computing Education Research, Koli Calling ’13, Koli, Finland, 14–17 November 2013; pp. 87–95. [Google Scholar] [CrossRef]
- Grover, S.; Basu, S. Measuring Student Learning in Introductory Block-Based Programming: Examining Misconceptions of Loops, Variables, and Boolean Logic. In Proceedings of the 2017 ACM SIGCSE Technical Symposium on Computer Science Education, SIGCSE ’17, Seattle, DC, USA, 8–11 March 2017; pp. 267–272. [Google Scholar] [CrossRef]
- Qian, Y.; Lehman, J. Students’ Misconceptions and Other Difficulties in Introductory Programming: A Literature Review. ACM Trans. Comput. Educ. 2017, 18, 1. [Google Scholar] [CrossRef]
- Kennedy, C.; Lawson, A.; Feaster, Y.; Kraemer, E. Misconception-Based Peer Feedback: A Pedagogical Technique for Reducing Misconceptions. In Proceedings of the 2020 ACM Conference on Innovation and Technology in Computer Science Education, ITiCSE ’20, Trondheim, Norway, 15–19 June 2020; pp. 166–172. [Google Scholar] [CrossRef]
- McCall, D.; Kölling, M. Meaningful categorisation of novice programmer errors. In Proceedings of the 2014 IEEE Frontiers in Education Conference (FIE), Madrid, Spain, 22–25 October 2014; pp. 1–8. [Google Scholar] [CrossRef]
- McCall, D.; Kölling, M. A new look at novice programmer errors. ACM Trans. Comput. Educ. 2019, 19, 38. [Google Scholar] [CrossRef]
- Kaczmarczyk, L.C.; Petrick, E.R.; East, J.P.; Herman, G.L. Identifying Student Misconceptions of Programming. In Proceedings of the 41st ACM Technical Symposium on Computer Science Education, SIGCSE ’10, Milwaukee, WI, USA, 10–13 March 2010; pp. 107–111. [Google Scholar] [CrossRef]
- Swidan, A.; Hermans, F.; Smit, M. Programming Misconceptions for School Students. In Proceedings of the 2018 ACM Conference on International Computing Education Research, ICER ’18, Espoo, Finland, 13–15 August 2018; pp. 151–159. [Google Scholar] [CrossRef]
- Sirkiä, T.; Sorva, J. Exploring programming misconceptions: An analysis of student mistakes in visual program simulation exercises. In Proceedings of the 12th Koli Calling International Conference on Computing Education Research, Koli Calling 2012, Koli Calling ’12, Koli, Finland, 15–18 November 2012; pp. 19–28. [Google Scholar] [CrossRef]
- Albrecht, E.; Grabowski, J. Sometimes It’s Just Sloppiness—Studying Students’ Programming Errors and Misconceptions. In Proceedings of the 51st ACM Technical Symposium on Computer Science Education, Portland, OR, USA, 11–14 March 2020; pp. 340–345. [Google Scholar] [CrossRef]
- Kumar, A.N. Generation of Demand Feedback in Intelligent Tutors for Programming. In Advances in Artificial Intelligence; Springer: Berlin/Heidelberg, Germany, 2004; pp. 444–448. [Google Scholar] [CrossRef]
- Sychev, O.; Penskoy, N.; Anikin, A.; Denisov, M.; Prokudin, A. Improving comprehension: Intelligent tutoring system explaining the domain rules when students break them. Educ. Sci. 2021, 11, 719. [Google Scholar] [CrossRef]
- Mitrovic, A.; Koedinger, K.R.; Martin, B. A Comparative Analysis of Cognitive Tutoring and Constraint-Based Modeling. In User Modeling 2003; Brusilovsky, P., Corbett, A., de Rosis, F., Eds.; Springer: Berlin/Heidelberg, Germany, 2003; pp. 313–322. [Google Scholar] [CrossRef]
- Pamplona, S.; Medinilla, N.; Flores, P. Exploring Misconceptions of Operating Systems in an Online Course. In Proceedings of the 13th Koli Calling International Conference on Computing Education Research, Koli Calling ’13, Koli, Finland, 14–17 November 2013; pp. 77–86. [Google Scholar] [CrossRef]
- Lieber, T.; Brandt, J.R.; Miller, R.C. Addressing Misconceptions about Code with Always-on Programming Visualizations. In Proceedings of the SIGCHI Conference on Human Factors in Computing Systems, CHI ’14, Toronto, ON, Canada, 26 April–1 May 2014; pp. 2481–2490. [Google Scholar] [CrossRef]
- Miedema, D.; Aivaloglou, E.; Fletcher, G. Exploring the Prevalence of SQL Misconceptions: A Study Design. In Proceedings of the 21st Koli Calling International Conference on Computing Education Research, Joensuu, Finland, 18–21 November 2021; Association for Computing Machinery: New York, NY, USA, 2021. [Google Scholar] [CrossRef]
- Kunkle, W.M.; Allen, R.B. The Impact of Different Teaching Approaches and Languages on Student Learning of Introductory Programming Concepts. ACM Trans. Comput. Educ. 2016, 16, 3. [Google Scholar] [CrossRef]
- Zehra, S.; Ramanathan, A.; Zhang, L.Y.; Zingaro, D. Student Misconceptions of Dynamic Programming. In Proceedings of the 49th ACM Technical Symposium on Computer Science Education, SIGCSE ’18, Baltimore, ML, USA, 21–24 February 2018; pp. 556–561. [Google Scholar] [CrossRef]
- Herman, G.L.; Kaczmarczyk, L.; Loui, M.C.; Zilles, C. Proof by Incomplete Enumeration and Other Logical Misconceptions. In Proceedings of the Fourth International Workshop on Computing Education Research, ICER ’08, Sydney, Australia, 6–7 September 2008; pp. 59–70. [Google Scholar] [CrossRef]
- Caceffo, R.; Wolfman, S.; Booth, K.S.; Azevedo, R. Developing a Computer Science Concept Inventory for Introductory Programming. In Proceedings of the 47th ACM Technical Symposium on Computing Science Education, SIGCSE ’16, Memphis, TN, USA, 2–5 March 2016; pp. 364–369. [Google Scholar] [CrossRef]
- Kelter, R.; Kramer, M.; Brinda, T. Statistical Frequency-Analysis of Misconceptions In Object-Oriented-Programming: Regularized PCR Models for Frequency Analysis across OOP Concepts and Related Factors. In Proceedings of the 18th Koli Calling International Conference on Computing Education Research, Koli Calling ’18, Koli, Finland, 22–25 November 2018. [Google Scholar] [CrossRef]
- Danielsiek, H.; Paul, W.; Vahrenhold, J. Detecting and Understanding Students’ Misconceptions Related to Algorithms and Data Structures. In Proceedings of the 43rd ACM Technical Symposium on Computer Science Education, SIGCSE ’12, Raleigh, NC, USA, 29 February–3 March 2012; pp. 21–26. [Google Scholar] [CrossRef]
- Gusukuma, L.; Bart, A.C.; Kafura, D.; Ernst, J. Misconception-Driven Feedback: Results from an Experimental Study. In Proceedings of the 2018 ACM Conference on International Computing Education Research, ICER ’18, Espoo, Finland, 13–15 August 2018; pp. 160–168. [Google Scholar] [CrossRef]
- Velázquez-Iturbide, J.A. Students’ Misconceptions of Optimization Algorithms. In Proceedings of the 2019 ACM Conference on Innovation and Technology in Computer Science Education, ITiCSE ’19, Aberdeen, UK, 15–17 July 2019; pp. 464–470. [Google Scholar] [CrossRef]
- Kurvinen, E.; Hellgren, N.; Kaila, E.; Laakso, M.J.; Salakoski, T. Programming Misconceptions in an Introductory Level Programming Course Exam. In Proceedings of the 2016 ACM Conference on Innovation and Technology in Computer Science Education, ITiCSE ’16, Arequipa, Peru, 11–13 July 2016; pp. 308–313. [Google Scholar] [CrossRef]
- Sanders, K.; Thomas, L. Checklists for Grading Object-Oriented CS1 Programs: Concepts and Misconceptions. ACM SIGCSE Bull. 2007, 39, 166–170. [Google Scholar] [CrossRef]
- Ardimento, P.; Bernardi, M.L.; Cimitile, M.; Redavid, D.; Ferilli, S. Understanding Coding Behavior: An Incremental Process Mining Approach. Electronics 2022, 11, 389. [Google Scholar] [CrossRef]
- Sychev, O.; Denisov, M.; Terekhov, G. How It Works: Algorithms—A Tool for Developing an Understanding of Control Structures. In Proceedings of the 26th ACM Conference on Innovation and Technology in Computer Science Education, ITiCSE ’21, Virtual Event Germany, 26 June–1 July 2021; pp. 621–622. [Google Scholar] [CrossRef]
- Fereday, J.; Muir-Cochrane, E. Demonstrating Rigor Using Thematic Analysis: A Hybrid Approach of Inductive and Deductive Coding and Theme Development. Int. J. Qual. Methods 2006, 5, 80–92. [Google Scholar] [CrossRef]
- Cohen, J. A Coefficient of Agreement for Nominal Scales. Educ. Psychol. Meas. 1960, 20, 37–46. [Google Scholar] [CrossRef]
- Kumar, A.; Dancik, G. A tutor for counter-controlled loop concepts and its evaluation. In Proceedings of the 33rd Annual Frontiers in Education, Westminster, CO, USA, 5–8 November 2003; Volume 1, p. T3C-7. [Google Scholar] [CrossRef]
Topic | Selection | Loops | Total: | ||
---|---|---|---|---|---|
Algorithms | 6 | 9 | 15 | ||
Trace kind | correct | erroneous | correct | erroneous | |
Traces | 7 | 7 | 14 | 12 | 40 |
Questions | 23 | 54 | 76 | 28 | 181 |
Respondents | 67 | 67 | 63 | 47 | 67 |
Answers given | 1539 | 3602 | 4254 | 1404 | 10,799 |
Answers with misconceptions | 32 | 85 | 21 | 42 | 180 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Sychev, O.; Denisov, M. Explain Trace: Misconceptions of Control-Flow Statements. Computers 2023, 12, 192. https://doi.org/10.3390/computers12100192
Sychev O, Denisov M. Explain Trace: Misconceptions of Control-Flow Statements. Computers. 2023; 12(10):192. https://doi.org/10.3390/computers12100192
Chicago/Turabian StyleSychev, Oleg, and Mikhail Denisov. 2023. "Explain Trace: Misconceptions of Control-Flow Statements" Computers 12, no. 10: 192. https://doi.org/10.3390/computers12100192
APA StyleSychev, O., & Denisov, M. (2023). Explain Trace: Misconceptions of Control-Flow Statements. Computers, 12(10), 192. https://doi.org/10.3390/computers12100192