Computer Science Students and Debugging

August 30, 2024
September 13, 2024

+ How Computer Science Students Learn

@lin2016 studied students' ability to effectively debug a program using an eye-tracking device. The goal of this study was to determine the cognitive processes (mainly problem-solving) used by both high and low performance students while debugging. The authors define a beacon as a potential area in the code that might be causing the bug. More experienced programmers are faster at locating these beacons. The eye-tracking was used to determine how the speed and accuracy of identifying beacons in both high and low performing students. The experiment was done on 22 male and 16 female undergraduate Computer Science students who had at least one year of experience in the C programming language. @lin2016 ultimately found that the low performing students were aimless and could not come up with a debugging plan of attack. High performing students were able to chunk the problem and build a solid mental model of the program and where the bug could be.

@chmiel2004 found that novice programmers lack this mental model and have a narrow scope of vision when debugging. They tend to jump to conclusions based on the first thing they see instead of understanding the problem in its entirety. Skilled programmers build a mental model of the program by analyzing the relationships between different areas of the program to better deduce potential problem areas. Novice programmers do not come up with hypotheses about where the problem could be coming from. Code reviews are an effective technique to identify and fix bugs. Novice programmers can learn much from their peers in this process (Chmiel & Loui, 2004, p. 17; Fitzgerald et al., 2010; Marques, Ochoa, Bastarrica, & Gutierrez, 2018; Murphy-Hill, 2014). @chmiel2004 designed activities to improve students' debugging capabilities at the University of Illinois in ECE 291 which is a course all computer engineering and electrical engineering students have to take. These activities were designed using strategies found in the literature. The study was conducted in Spring of 2003 and it involved 27 students. Students were given code that contained bugs. They were tasked with analyzing the code during a code review process to identify, but not fix, as many bugs as they could find in the code. Identification of the bug is the first step in the debugging process. Then, the students were given different programs with the task of first identifying the bugs and then fixing the bugs. The students had access to a debugging tool so that they could step through the code, set breakpoints, and read the values of all the variables. During this process, the students were tasked with keeping a log of all the bugs. They had to write down information such as which function the bug was coming from, how long it took them to fix, and the desired output vs the actual output of the program, and the fix itself. This log could then be referred to later if they ever encountered a similar bug. @chmiel2004 [p. 19] found significant results regarding the time spent debugging by students who had done the debugging exercises versus the students who had not. Debugging directly engages the problem solving ares of a student's brain and must be practiced repeatedly to get better at (Chmiel & Loui, 2004, p. 21).

Debugging is hard for novice programmers since it requires several other skills to do effectively (Fitzgerald et al., 2010). Students must know the bare minimum programming fundamentals, be able to read code and understand what the different instructions mean, and have a general idea of where the problem could be coming from. They must also be able to recall information, identify the correct context of the problem, and use programming constructs correctly. @fitzgerald2010 [p. 390] hoped to analyze the differences between what students said they did versus what they actually did to identify gaps in their knowledge. The authors identified that much of the research about the debugging skills of students was done in the 1980s. Their study aimed to utilize strategies from those older studies using the context of modern programming environments during the Spring of 2007 at six universities in the United States and one university in the United Kingdom. The study involved students doing a programming exercise, debugging the program, participating in an interview, and filling out a debugging survey (Fitzgerald et al., 2010, p. 391). The authors report that debugging requires strong problem-solving skills and strategies and that debugging should be explicitly taught by teachers. The students should be tasked with thinking about all the different ways the error could be happening before allowing them to alter the code. This would involve going back to the problem statement to nail down exactly what the desired output should be. Students must practice articulating between "desired output" and "actual output". To reduce cognitive overload, teachers should take care to only use one programming style (ex. naming conventions, brace placement, etc.) (Fitzgerald et al., 2010, p. 395). Software testing and debugging go hand in hand. Teaching the students about good testing practices through live testing demonstrations can enable students to think about what the desired results should be (Fitzgerald et al., 2010, p. 395). The authors posit that for extremely novice programmers, using the internet to search for solutions should be discouraged since these students can easily get lost in the plethora of information and resources that exist on the web. They conclude by stating that more research should be done about the novice programmer's use of the internet to solve problems (Fitzgerald et al., 2010, p. 396).

In software development, the use of the internet and search engines is prevalent when debugging ben-davidkolikant2018.

📚 References

  1. ben-davidkolikant2018
  2. chmiel2004
  3. fitzgerald2010
  4. lin2016

References

Chmiel, R., & Loui, M. C. (2004). Debugging: From novice to expert. ACM SIGCSE Bulletin, 36(1), 17–21. https://doi.org/10.1145/1028174.971310
Fitzgerald, S., McCauley, R., Hanks, B., Murphy, L., Simon, B., & Zander, C. (2010). Debugging from the student perspective. IEEE Transactions on Education, 53(3), 390–396. https://doi.org/10.1109/TE.2009.2025266
Marques, M., Ochoa, S. F., Bastarrica, M. C., & Gutierrez, F. J. (2018). Enhancing the student learning experience in software engineering project courses. IEEE Transactions on Education, 61(1), 63–73. https://doi.org/10.1109/TE.2017.2742989
Murphy-Hill, E. (2014). The future of social learning in software engineering. Computer, 47(1), 48–54. https://doi.org/10.1109/MC.2013.406