Abstract
Reintroducing computer science (CS) education in K–12 schools to promote computational thinking (CT) has attracted significant attention among scholars and educators. Among the several essential components included in CS and CT education, program debugging is an indispensable skill. However, debugging teaching has often been overlooked in K–12 contexts, and relevant empirical studies are lacking in the literature. Moreover, novices generally have poor performance in domain knowledge and strategic knowledge concerning debugging. They also consistently experience a high cognitive burden in debugging learning. To address these gaps, we developed a flipped systematic debugging approach combined with a systematic debugging process (SDP) and the modeling method. A quasi-experimental study was conducted to explore the effectiveness of this flipped systematic debugging approach, in which 83 fifth-grade students attended the flipped debugging training lessons with the SDP–modeling method, and 75 fifth-grade students attended the unassisted flipped debugging training lessons without the SDP–modeling method. The results indicated that flipped debugging training using the SDP–modeling method improved students’ debugging skills. The results from the questionnaire showed that the proposed teaching approach increased the students’ investment in germane cognitive load by promoting schema construction. It also helped reduce students’ intrinsic and extraneous cognitive load in learning.
Introduction
There is a growing demand to reintroduce computer science (CS) education in K–12 contexts to promote computational thinking (CT) (Franklin et al., 2020). Papert’s (1980) early work indicated that programming could be a powerful approach to teaching CT to young students. However, novices can rarely build effectively running computer programs at the first attempt and must perform multiple debugging iterations to correct the faulty outcomes (Akcaoglu & Koehler, 2014).
Debugging is an iterative cognitive process of systematically diagnosing and repairing errors to correct faulty programs (Michaeli & Romeike, 2019b; Wu et al., 2019), which can be regarded as a problem-solving activity (Lye & Koh, 2014). In this study we focused on program debugging education because debugging can allow students to learn from problems or failures, eliminate misconceptions and enhance their understanding of CS concepts (Michaeli & Romeike, 2019a; Zhong & Si, 2021). Moreover, debugging skills can be leveraged to solve relevant problems in non-programming domains (Emara et al., 2020) and real-life scenarios (Michaeli & Romeike, 2019b).
However, program debugging is a challenging task for novices (Falloon, 2016; Kim et al., 2018) for three reasons: poor student performance in domain knowledge and strategic knowledge, huge cognitive burdens induced by debugging learning, and the lack of emphasis on program debugging as a separate teaching practice in K-12 CT education.
Specifically, first, novices lack the required domain knowledge and strategic knowledge (Liu et al., 2017; Murphy et al., 2008). Domain knowledge refers to knowledge of the relevant concepts, constructs, relations and rules of the underlying programming language (Li et al., 2019). Novices typically develop a shallow understanding of basic concepts, which increases the difficulty of interpreting the executed results of specific sets of commands (Pea, 1986), inferring error causes (Fitzgerald et al., 2010; Kim et al., 2018) and correcting errors. Strategic knowledge refers to knowledge of debugging methods, which can guide novices to plan effective problem-solving solutions (Li et al., 2019). Novices often lack effective debugging strategies or cannot apply strategies efficiently (Michaeli & Romeike, 2019a; Murphy et al., 2008). For example, novice programmers generally revise problematic programs without any plan (Chen et al., 2013). They tend to make minor changes randomly to decrease the difference between the faulty and goal programs (Bers et al., 2014; Liu et al., 2017), during which they sometimes forget to revert incorrect modifications (Michaeli & Romeike, 2019b) and introduce new errors easily. It is difficult for novices to obtain excellent debugging skills by merely learning how to write programs (Fitzgerald et al., 2010). Thus, novices should be provided with explicit teaching instructions to learn effective debugging strategies and enhance concept comprehension (Chiu & Huang, 2015; O’Dell, 2017).
Second, in addition to the lack of domain knowledge and strategic knowledge, performing various subtasks (e.g., recognizing discrepancies, inferring errors, fixing errors) to debug programs may induce high cognitive load (Zhong & Si, 2021). Novices typically lack effective schemata and relevant experience in debugging (Van Gog et al., 2006); therefore, they must simultaneously process different types of information in their working memory when debugging. Novices’ learning is negatively affected once the debugging task–imposed cognitive load exceeds their working memory capacity (Shadiev et al., 2015). Thus, effective instructional approaches for debugging should be designed to optimize different types of cognitive load as perceived by novices in learning.
Third, despite its importance, debugging teaching has often been overlooked, especially in K–12 education (Michaeli & Romeike, 2019b). Empirical studies exploring effective debugging teaching approaches are lacking (Michaeli & Romeike, 2019a). Owing to the lack of time for student active learning, classroom teachers prefer to directly provide students with error-correction solutions or leave them alone with error-processing tasks, rather than explicitly teach them program debugging (Michaeli & Romeike, 2019b).
Given the above concerns, it is important for us to conduct research to develop an effective instructional approach for debugging and evaluate its effects on debugging teaching in actual elementary classrooms. Enhancing novices’ domain knowledge and strategic knowledge should be the priority of debugging teaching. Novices’ cognitive burden in learning should also be optimized in the design of effective teaching instructions (Klepsch & Seufert, 2020).
This study makes the following contribution to the literature: It proposes a flipped systematic debugging approach to enhance elementary students’ debugging skills and optimize three types of cognitive load imposed on them. The flipped debugging approach uses a systematic debugging process (SDP) containing four debugging steps to familiarize students with effective debugging strategies, and the modeling method to facilitate students’ acquisition of domain and strategic knowledge (Kale & Yuan, 2021) required for debugging. This flipped systematic debugging approach can serve as a reference for other researchers and educators to replicate or improve the instructional design on debugging. Moreover, this study provides experimental results on student performance in debugging and cognitive load to show the effectiveness of the proposed flipped systematic debugging approach. The results are based on the application of the proposed debugging teaching approach in training 158 fifth-grade elementary students. Overall, this study enriches empirical research concerning the development of effective debugging teaching approaches.
Conceptual Background
Program Debugging Models
Scholars have developed different models to illustrate the debugging process. For example, Vessey (1985) proposed the following goal hierarchy for debugging: 1) problem identification by comparing the outputs of the desired and faulty programs; 2) understanding of the program structure; 3) program examination according to the execution order; 4) formation of hypotheses to infer bugs; and 5) bug correction. Similarly, Carver and Risinger (1987) designed a debugging model that included the following five phases: program assessment, bug identification, program representation (specifying the command set in which a bug may exist), bug location and bug correction. Yoon and Garcia (1998) developed a two-step approach for debugging; step one involved comprehending the program and finding discrepancies, while step two involved isolating bugs, repairing them and re-evaluating solutions.
Although the different debugging models may contain different labels or descriptions of debugging subtasks, we can parsimoniously group all the essential subtasks into four major components (Figure 1): problem identification and representation (e.g., comparing the program goals and outputs), bug location (e.g., understanding the program structure), bug correction, and solution evaluation. These four essential subtasks constitute the fundamental steps that students generally experience during debugging. Using a systematic stepwise approach to guide students through debugging is likely to improve their debugging skills by increasing their debugging speed and correctness and decreasing the number of introduced errors (Carver & Risinger, 1987; Michaeli & Romeike, 2019b). The following sections explain each step in more detail. Framework showing the systematic program debugging process.
The debugging process begins with the problem identification and representation step. This step requires students to comprehend the objectives of the desired program and compare them with the outcomes of the faulty program. Students then hypothesize likely errors based on the identified discrepancies. Young novices tend to skip the discrepancy detection step and revise the faulty program based on their intuition (Kale & Yuan, 2021; Liu et al., 2017). Since the ability to recognize whether the actual outputs match the desired outputs is foundational to successful debugging (Rich et al., 2019), discrepancy recognition should be emphasized. Moreover, discrepancies may remind students of familiar error symptoms and corresponding stereotypical patterns of errors, which can help them speculate future likely errors (Li et al., 2019).
The next step is bug location, in which students need to understand the basic structure of the program and hypothesize the possible locations of each error. Decomposing the whole program into several subsections with distinct functions enhances students’ comprehension of its structure and logic, which improves their error localization speed. Considering that novices generally have a low ability to decompose programs (Lin et al., 2016), some measures can be taken to help them comprehend programs. Specifically, teachers can split certain parts of the program into sub-procedures and use meaningful names for these sub-procedures and the associated variables. Teachers can also provide novices with a simple textual introduction to sub-procedure functions (Li et al., 2019). When hypothesizing possible error locations, students should be encouraged to narrow their error search to specific program parts (e.g., specific sub-procedures) based on clues from the previous step (Carver & Risinger, 1987). Otherwise, they need to read each line of program code, which increases their time spent on error localization (Li et al., 2019). Moreover, students can narrow the set of error searches with the help of the program execution visualization in programming tools (e.g., Scratch) (Li et al., 2019).
The third step, bug correction, requires proposing solutions to repair each error found. Then, the fourth step, evaluation, requires students to check whether the repair attempts successfully revert the faulty program to the correct state. Improving novices’ ability to evaluate and adjust hypotheses is crucial to effectively debug faulty programs (Li et al., 2019). Solution evaluation is an iterative process. Testing the solution’s correctness immediately after one repair attempt helps students trace its effectiveness. When a solution produces the desired result, students should determine whether other errors exist. When a solution cannot resolve the original error, students should first undo the incorrect modifications to avoid introducing new errors (Rich et al., 2019) and then restart the debugging process cycle. According to evaluation results, they need to conduct some or all of the debugging steps to generate and assess an alternative solution. Debugging iterations continue until the faulty program arrives at the correct state.
Although the use of the systematic debugging steps can help develop students’ debugging skill (Michaeli & Romeike, 2019b; O’Dell, 2017), previous research (e.g., Böttcher et al., 2016) found that approximately half of the students could not effectively apply the systematic debugging approach in debugging tasks even after training. This may be partly due to the associated high cognitive burden, especially for novices (Zhong & Si, 2021). Novices’ cognitive burden in learning should be optimized in the design of effective teaching instructions (Klepsch & Seufert, 2020).
Cognitive Load Theory
Cognitive load theory (CLT) explains that students experience intrinsic cognitive load (ICL), extraneous cognitive load (ECL) and germane cognitive load (GCL) in learning (Van Gog et al., 2006). ICL is determined by the complexity of the learning content, students’ relevant expertise and the interaction between them (Sweller et al., 1998). The complexity of a task largely depends on the degree of element interactivity (Chen et al., 2015). Element interactivity is “a measure of informational complexity” (Sweller, 2020, p. 8). High element interactivity implies that students must simultaneously process a large number of interacting elements and their relationships, which is challenging (Van Merriënboer & Sweller, 2005). In contrast, low element interactivity means that students need to process merely a few interacting information elements at a time. For example, understanding the following script to draw a rectangle has high element interactivity: repeat 2 {move 30 steps; turn left 90°; move 60 steps; turn left 90°}. This script contains seven single elements that students must know first, namely, the repeat, move and turn left commands and the corresponding numbers: 2, 30, 90 and 60. Students must also simultaneously process the relationships between these elements to identify the rectangle obtainable by this script. A task’s element interactivity changes with the students’ expertise level (Sweller, 2020). Students with sufficient expertise can construct various cognitive schemata to store knowledge in their long-term memory. These students can more easily process numerous interacting elements as a few elements or a single one, thus relieving their working memory burden (Sweller, 2020). For tasks with high element interactivity, encouraging novices to build schemata to incorporate interacting elements can help reduce the associated ICL (Chen et al., 2015).
Germane cognitive load is mental work directly contributing to learning. It can generally be induced by appropriate instructional activity design and used to comprehend required learning materials (Shadiev et al., 2015). Inducing GCL through appropriate teaching approaches (e.g., providing guidance, arranging different versions of a task in random order during practice rather than arranging one version of a task repeatedly) can motivate students to invest their cognitive resources in schema construction (Van Merriënboer & Sweller, 2005). Moreover, encouraging students to study expert solutions (e.g., program debugging strategies) can promote GCL to stimulate students to construct the relevant schemata (Van Gog et al., 2004). For example, demonstrating different program debugging tasks containing repeat instruction, repeat-until instruction, or the combination of loops instruction with the conditionals instruction in loops concept teaching may evoke GCL among students, helping them construct more accurate cognitive schemata of related concepts (Wang et al., 2018). Allowing students to observe experts’ debugging processes may also stimulate students to invest cognitive resources in developing a deeper understanding of problem-solving strategies. GCL is related to students’ efforts to acquire concepts and skills (Van Gog et al., 2006). Higher GCL means students put more effort into concept comprehension and skill acquisition.
Extraneous cognitive load is associated with the instructional format used in the teaching and learning process (Chen et al., 2015; Shadiev et al., 2015). Improper instructional design can impose excessive ECL on students, which may overburden students’ limited working memory and prevent them from engaging in meaningful learning processes such as information processing and schema construction (Van Merriënboer & Sweller, 2005). For example, explaining the loops concept merely in a verbal way without demonstrating its construct and application through the computer may increase ECL as experienced by students. Moreover, the program debugging process require students to search through various possible strategies and solutions, identify an effective solution among these possibilities and implement the solution to move closer to the goal state. Students who lack support and use resource-intensive processes such as trial and error may experience high ECL (Van Merriënboer & Sweller, 2005). Excessive ECL negatively affects students’ learning, leading to longer learning time, lower learning performance or both (Wang et al., 2018). In contrast, providing explicit instructional guidance such as detailed demonstrations or appropriate debugging strategies can reasonably decrease interacting elements students need to process relevant to the problem-solving process and reduce the associated ECL (Sweller, 2020). Figure 2 shows the possible relationship between the various types of cognitive load in the domain of program debugging. Cognitive load relationships in program debugging (adapted from Garner, 2002).
Instructional Design on Program Debugging
To enhance elementary students’ debugging skills and optimize their different types of cognitive load, this study developed a flipped debugging teaching approach combined with the SDP method (Figure 1) and the modeling method and applied this flipped teaching in actual debugging teaching practice.
How systematic debugging process may help?
The four steps included in the SDP can be presented as question prompts to scaffold novices’ debugging processes. The use of scaffolding to explain the essential problem-solving steps can enhance novices’ learning and balance their cognitive load (Shadiev et al., 2015). Scaffolding allows novices to undertake essential but easily ignored subtasks, helping them stay on track to solve problems. This enhances their understanding of the debugging process and promotes their strategic knowledge development (Kale & Yuan, 2021). Furthermore, the heuristic nature of stepwise approaches means that scaffolding does not guarantee a correct solution (Van Gog et al., 2004), which offers novices opportunities to process information and make inferences independently.
Furthermore, scaffolding presenting problem-solving steps may help balance the different types of cognitive load in novices when learning. First, it may help optimize ICL. Debugging requires novices to simultaneously handle various elements and their relationships (e.g., recalling programming concepts and structures, describing discrepancies, inferring and correcting errors). This can lead to the high element interactivity of debugging. The stepwise problem-solving approach can distribute the complexity of the task to different subtasks. By limiting the number of information elements, scaffolding allows novices to simultaneously process relatively fewer elements in each subtask and thus minimise ICL (Van Merriënboer & Sweller, 2005). Second, scaffolding may reduce ECL. Weak problem-solving strategies (e.g., haphazard tinkering, trial and error) can be avoided by providing novices with problem-solving steps. Moreover, novices can consult the scaffolding tool to check subsequent steps and thus do not need to remember all the required steps, which relieves their cognitive burden and reduces ECL. Third, using the scaffolding tool may stimulate novices to establish useful cognitive schemata to increase their perceived GCL. The variability of problem situations contributes to novices’ schemata establishment (Van Merriënboer & Sweller, 2005). Debugging diverse faulty programs using the scaffolding tool in debugging exercises may help novices get familiarized with the systematic debugging process and grasp meaningful debugging strategies (e.g., debugging steps, incorrect-revision undo strategy), thus building relevant cognitive schemata. The schema construction can improve novices’ expertise level and consequently reduce their perceived ICL (Sweller, 2020).
How the modeling method may help?
The modeling method helps novice students acquire domain knowledge and strategic knowledge by demonstrating the problem-solving process (Kale & Yuan, 2021). Similar to example-based learning (Van Gog et al., 2019), this method emphasizes examples (Kale et al., 2018), encouraging students to observe the problem-solving process that an experienced problem solver (e.g., a teacher) is performing (i.e., modeling examples) or has completed (i.e., worked-out examples). Modeling examples can be presented through live or video demonstrations (Van Gog et al., 2019; Kale et al., 2018). During demonstrations, the experienced problem solver can inform novices of effective problem-solving strategies and explain the thoughts involved in the reasoning activities and the rationale for selecting the solution steps (Kant et al., 2017). Such demonstrations can help novices fill their knowledge gaps and build useful cognitive representations of problem-solving behaviors (Van Gog & Rummel, 2010; Wittwer & Renkl, 2010). This will allow novices to apply the knowledge acquired to effectively address similar issues in later situations (Kant et al., 2017).
Based on the CLT perspective, listening to experts’ instructions and observing their actions can help novice students focus on crucial knowledge (e.g., domain concepts, strategy selection, rationales for decision-making) involved in solving problems (Van Gog et al., 2004). This may induce GCL in students by encouraging them to construct meaningful cognitive schemata concerning concepts and debugging strategies (Kant et al., 2017), which will decrease their ICL (Sweller, 2020). However, the distracting information included in face-to-face demonstrations may increase ECL because novices are likely to spend part of their cognitive resources on irrelevant details (e.g., the teacher’s tone of voice) and unclear explanations (Van Gog & Rummel, 2010). Moreover, the model’s behavior (natural or didactic) may affect ECL as perceived by students (Van Gog & Rummel, 2010). Compared with showing erroneous or ineffective solutions, demonstrating effective strategies and reasoning processes clearly can minimize novices’ ECL.
Why use the flipped classroom approach?
The flipped classroom approach comprises two stages: the self-leaning stage and the in-class learning stage, aiming to increase active learning opportunities and student active participation (Gao & Hew, 2022). The self-learning stage allows students to learn at home at their own pace through pre-class video lectures and online quizzes. Video lectures enable students to pause or replay the video when they encounter difficult-to-understand content, which helps manage their working memory burden (Clark et al., 2005). The in-class learning stage focuses on active learning, engaging students in higher-order cognitive activities (Gao & Hew, 2022). These active learning activities (e.g., problem-solving debugging tasks) allow students to apply their knowledge to tackle problems (e.g., correct errors included in faulty programs), which improves their understanding of the learned concepts and promotes skill development (Deslauriers et al., 2019; Gao & Hew, 2022).
Research Questions
In this study, the experimental group employed the flipped debugging teaching approach combined with the SDP–modeling method, while the control group used the unassisted flipped debugging teaching approach (i.e., without the SDP–modeling method). The flipped classroom procedure was used for both groups to increase students’ active learning opportunities and active engagement. The effects of the SDP–modeling method on debugging learning of 158 fifth graders were measured. This study was guided by the following research questions: 1) What is the effect of flipped debugging training with the SDP–modeling method on elementary student performance in program debugging? 2) What is the effect of flipped debugging training with the SDP–modeling method on elementary student performance in three types of cognitive load?
Method
This study aimed to examine the effects of the flipped debugging teaching approach using the SDP–modeling method on student performance in program debugging and cognitive load. A quasi-experimental design with experimental-control groups was adopted in this study. The student performance on debugging tests, including a pretest, midterm test, posttest and delay test, was collected and analyzed. Data on a cognitive load questionnaire (CLQ) were also collected to explore the students’ three types of cognitive load in each lesson.
Participants
Demographic information for participants from two groups.
Experimental Procedure
Figure 3 depicts the experimental procedure design. The students took a debugging pretest in the first week to gauge their initial debugging skill level. Afterward, the experimental and control groups attended four debugging training lessons (one lesson per week) under different teaching conditions. Between the second and third lessons, both groups took a debugging midterm test. After the lessons were completed, the students took a debugging posttest. One week later, they took a delayed debugging test. Research design diagram.
The lesson content and debugging tasks of debugging training (Figure 4) focused on fundamental concepts (e.g., sequences, loops, conditionals, variables) included in the K–12 CS framework (K–12 Computer Science Framework Steering Committee, 2016) and the CT literature (e.g., Tsai, 2019). The pre-class learning sessions helped familiarize students with domain knowledge (e.g., basic concepts), while the in-class sessions provided students with active learning opportunities (e.g., debugging exercises). Each participant was assigned a computer to watch the teacher’s demonstrations and debug faulty programs in Scratch (https://scratch.mit.edu/). Key learning content of program debugging lessons.
Design of flipped debugging training with the SDP–modeling method for the experimental group
Figure 5 shows the flipped debugging lesson schedule for the experimental group. In each lesson, the experimental group was required to watch the video lectures and complete the online quizzes before class through the learning management system (https://cas.xueleyun.com/). At the start of the face-to-face learning sessions, the teacher briefly reviewed essential preview learning content to activate students’ prior knowledge. The teacher then guided students by discussing high-error-rate quiz questions to eliminate misunderstandings. The flipped debugging lesson design for the experimental group.
Afterward, the teacher presented a detailed demonstration of the program debugging process because of the application of the modeling method. Based on the scaffolding tool example illustrated (Figure 6), the teacher demonstrated the process of debugging a faulty program using the SDP approach (Figure 1) and explained why errors were solved with this approach. After the teacher demonstration, the students were provided with concept application opportunities for developing their debugging skills. They were asked to independently think about how to correct the given faulty program to achieve the required goals. During this period, the students were offered the scaffolding tool showing the SDP (Figure 7) to guide their problem-solving process. The students were not allowed to share ideas with peers, given that they needed to rate their perceived cognitive load in learning. Moreover, the teacher provided students with only technical support (e.g., the use of the programming tool) when necessary. After the debugging activity ended, the participants were required to complete the CLQ to rate their perceived different types of cognitive load during learning. The scaffolding tool example used in the teacher demonstration in the second lesson. The scaffolding tool used for the experimental group in the third lesson.

Design of unassisted flipped debugging training for the control group
Figure 8 indicates the flipped debugging lesson schedule for the control group. As in the experimental group, the control group also needed to watch the same video lectures and complete the same online quizzes before class. The control group then reviewed the same key content and discussed the same quiz questions at the beginning of each lesson under the teacher’s guidance. The main difference in the activity arrangement between the control and experimental groups lies in the design of the teacher demonstration and problem-solving activity. Specifically, during the teacher’s brief demonstration, the control group observed only error repair demonstrations and the final error-correction results instead of the detailed debugging process (e.g., the use of the SDP approach, error reasoning processes). Moreover, in the problem-solving activity, the students were asked to complete debugging tasks without the scaffolding tool. Faulty programs used in teacher demonstrations and debugging exercises were the same as those for the experimental group. Similarly, the control group students could receive only technical support and were not allowed to share ideas with peers during debugging exercises. Finally, the students completed the CLQ to rate their perceived three types of cognitive load in learning. The flipped debugging lesson design for the control group.
Data Collection
Program debugging test
To assess the students’ overall performance in debugging, the teacher required them to debug faulty programs on computers. The students received 11 test tasks of different difficulty levels and were required to correct as many malfunctioning programs as possible within 20 minutes. Each task contained one faulty program with one to four injected logical errors. Faulty programs included in test tasks were designed based on examples of programming books and CT tests. The logical errors injected were developed based on bugs that the students encountered during their previous programming lessons and commonly reported misconceptions in the literature (e.g., Swidan et al., 2018). These errors (n = 27) were related to sequences (number of errors: n = 6), loops (n = 9), parameter passing (n = 3), variables (n = 6) and conditionals (n = 3). Figure 9 and Figure 10 show examples of the second posttest task, with sequence and loop errors. Example of the handbook page containing basic task information for the second task in the program debugging posttest. Example of the second task included in the program debugging posttest, including the faulty program, likely error options, and corresponding correction options for each error.

In each test, we provided students with a handbook covering essential task information (e.g., the pictures showing the current running result of the faulty program and its goal running result, the number of errors per problematic program) (see Figure 9). Another handbook containing faulty programs (see Figure 10), likely error options (three to seven) and corresponding correction options (two to three) for each error was also provided for reference when the students got stuck in problems.
The students were asked to take the program debugging test four times. The debugging midterm test, posttest and delay test were slightly modified based on the debugging pretest. Similar to the debugging pretest, each of the other three debugging tests contained 11 debugging tasks with 27 logical errors that needed to be fixed. Although the four tests were not identical, their content scope, item structures and difficulty level were similar.
Several measures were taken to enhance the validity and reliability of program debugging tests. Specifically, developing debugging tests based on previous relevant work contributes to the improvement of the validity and reliability of these measurement instruments. To ensure the validity of debugging tests, the first author revised the debugging midterm test, posttest and delay test based on the corresponding pretest script to prevent students from recalling the test items and related answers in the pretest. Each test’s test scripts and results were also not discussed with or returned to the students to avoid cheating. Moreover, refinement based on experts’ feedback helped enhance the validity of debugging tests. All four debugging tests were developed by the first author and checked by two other experts with extensive programming experience. Debugging tests were revised and refined based on experts’ suggestions. The first author also invited an elementary Chinese language teacher with 30-year teaching experience to offer suggestions on the program debugging task descriptions to ensure that the question descriptions could be understood by elementary school students. Additionally, the test procedure used for debugging tests remained identical for the two groups at each measurement time point since unstandardized test procedures may produce unreliable data.
Cognitive load questionnaire
To evaluate the cognitive load imposed on students by the two debugging training types, we used the CLQ to measure students’ perceived three types of cognitive load throughout each lesson. The CLQ was adapted from subjective rating scales developed by Leppink et al. (2013, 2014). Their rating scales could identify three types of cognitive load and have been widely used in the relevant literature (Mutlu-Bayraktar et al., 2019). The adapted CLQ fitted the debugging teaching context and included 13 items on three subscales. Specifically, one subscale with five items measured perceived ICL (e.g., The content of this debugging activity was very complex), while the other two with four items separately assessed perceived ECL (e.g., The instructions and explanations during the activity were very unclear) and GCL (e.g., The activity really enhanced my understanding of the concepts and definitions). All questionnaire items were rated on a 7-point Likert scale, with 1 indicating ‘completely disagree’ and 7 indicating ‘completely agree’.
The first author developed the CLQ by referring to widely-applied scales designed by Leppink et al. (2013, 2014) and adapted all question items in the CLQ to fit better the program debugging context. This helps improve the validity and reliability of this measurement instrument. Before the actual implementation, the questionnaire was translated from English to Chinese by the first author and another bilingual native Chinese expert. The validity of the questionnaire translation was checked, and differences were resolved through discussions. All participants were asked to complete the CLQ on paper in each lesson, during which the teacher explained the rating items in detail to ensure that students fully understood the items. The participants immediately handed in the CLQ upon completion.
Data Analysis
Program debugging test
In each test, 27 logical errors were inserted into 11 faulty programs. To enhance the validity of the test, we developed our evaluation criteria for debugging tests based on similar assessment criteria used by other scholars (e.g., Fitzgerald et al., 2008) to accurately assess students’ overall performance in program debugging. In addition to the number of corrected errors, the number of newly introduced errors was also used as an indicator to assess students’ debugging skills. The students were given 1 point separately when fixing one error or introducing one error. The final test score was the difference between the total points of the two indicators, with a maximum of 27 points. Approximately 32% of the debugging test data (n = 632) were scored carefully by two raters (the first author and one expert with rich programming experience) to determine the reliability of the analysis. Cohen’s kappa coefficient was 0.984 (p < .001, 95% CI [0.980 to 0.988]), indicating excellent inter-rater reliability (Landis & Koch, 1977). The first author completed the remaining scoring task after resolving all differences.
A 2 × 4 mixed-design analysis of variance (ANOVA) was conducted to determine the effects of flipped debugging training using the SDP–modeling method on student performance over time. The within-subjects factor was the measurement time, with four levels (i.e., pretest, midterm test, posttest and delay test). The between-subjects factor was the debugging training type (i.e., flipped debugging training with the SDP–modeling method and unassisted flipped debugging training). The students’ test scores were used as the dependent variable. The debugging test data satisfied the normal distribution. Since the test data violated the assumption of sphericity based on Mauchly’s test, we used Greenhouse-Geisser correction when reporting relevant results. When the ANOVA yielded significant results (p < .05), further comparisons in the mean score differences were conducted through Bonferroni-corrected pairwise comparisons to minimize the probability of making Type-I error and improve the reliability of analysis results. The partial eta squared statistic (
Cognitive load questionnaire
The internal consistency of the CLQ and its three subscales were estimated using Cronbach’s alpha. Reliability analysis revealed the range of Cronbach’s alpha values to be between 0.854 and 0.890 for the full CLQ and between 0.766 to 0.867 for its three subscales (i.e.,
Results
Students’ Performance on Program Debugging Tests
A 2 (debugging training type) × 4 (measurement time) ANOVA revealed a significant repeated measurement main effect on the students’ test scores (F (2.741, 427.576) = 325.299, p < .001,
Mean Scores (SD) on Each Debugging Test for the Two Groups, and Analysis Results of the Simple Main Effect of the Debugging Training Type.
Meanwhile, the simple main effect of measurement time revealed that the mean scores significantly changed as the debugging lessons proceeded for both the experimental group (F (3,154) = 194.319, p < .001,
Students’ Perceived Cognitive Load
To evaluate the rating differences in each type of cognitive load per lesson between the control and experimental groups, we mainly presented analysis results concerning the debugging training type. The analysis results based on the two-factor mixed-design ANOVA uncovered significant main effects of the debugging training type on students’ ratings for ICL (i.e., F (3,154) = 13.319, p < .001,
Descriptive Statistics of Cognitive Load Data, and Analysis Results of the Simple Main Effect of the Debugging Training Type for Each Type of Cognitive Load.
Note. CL = Cognitive load.
In subsequent lessons, the experimental group perceived significantly lower ICL (all p < .01) and ECL (all p < .05) than the control group (Table 3). Yet, the experimental group experienced significantly higher GCL in learning program debugging (all p < .001). These results suggest that teaching students program debugging with the SDP–modeling method could help optimize their debugging learning-induced cognitive load by reducing their ECL and ICL but improving their GCL.
Discussion
This study compared the effects of two debugging training types (i.e., flipped debugging training combined with the SDP–modeling method vs. unassisted flipped debugging training) on elementary student performance in debugging and cognitive load. The students in both training conditions learned the same concepts and completed the same debugging tasks.
Student Performance in Program Debugging
No significant difference in student performance between the two debugging training types was detected in the debugging pretest. This result is expected because none of the participants had received specific training on debugging skill development in either school or extracurricular courses before the study. However, both groups considerably improved their scores from the pretest to the midterm test and from the midterm test to the posttest. Thus, novices can obtain beneficial debugging experience by practicing how to debug programs containing various errors (Li et al., 2019).
Additionally, the students who attended the debugging training lessons based on the SDP–modeling method consistently performed better in the midterm test and posttest than those who attended the unassisted debugging lessons. Since the students in the control group did not receive explicit instructions on the SDP and learn from teacher demonstrations, their typical approach was to construct basic schemata via random generation and test processes (Chen et al., 2015). That is, the students tended to fix errors by randomly generating possible error-correction solutions and checking their effectiveness. Generally, the unsuccessful modifications were jettisoned, and the successful ones were retained. Students may accumulate meaningful debugging experience by retaining some of the successful modifications in their long-term memory. However, owing to the lack of instructions, students may spend significant cognitive resources constructing accurate schemata (McLaren et al., 2016). This explains why these students underperformed those in the experimental group in the last three tests.
In contrast, the application of the SDP and modeling method helped novices in the experimental group acquire domain and strategic knowledge (e.g., error-related knowledge, SDP, undo strategy) (Kale & Yuan, 2021). Specifically, through teacher demonstrations, these students learned the systematic debugging method and error reasoning process. In subsequent exercises, following the problem-solving steps provided by the scaffolding tool to debug faulty programs might enhance their familiarity with the SDP. Practice opportunities help students recognize deficiencies in their cognitive schemata, which may challenge them to invest more effort in knowledge acquisition (Kant et al., 2017). The emphasis on reverting wrong revisions can prevent novices from introducing new errors (Michaeli & Romeike, 2019b). This debugging training type, therefore, improves students’ learning outcomes. Based on their empirical study, Michaeli and Romeike (2019b) similarly concluded that compared with the use of the teaching approach of asking students to complete debugging exercises independently, the implementation of explicit teaching instructions on debugging has a more positive effect on student performance.
Unlike the students in the unassisted flipped debugging training group, the students in the flipped debugging training group using the SDP–modeling method performed significantly better in the delay test than in the posttest. Moreover, the score difference between the two groups in the delay test was larger than that in the posttest. The students in the flipped debugging training group using the SDP–modeling method outperformed those in the unassisted flipped debugging training group in the delay test owing to the following two reasons. First, the students in the flipped debugging training group using the SDP–modeling method were more likely to spend less time identifying discrepancies and locating and correcting errors when dealing with familiar debugging tasks. Second, by using meaningful cognitive schemata (e.g., SDP), these students might be able to narrow their error search and thus improve their debugging speed and accuracy when dealing with unfamiliar tasks (Carver & Risinger, 1987).
Student Performance in Three Types of Cognitive Load
In addition to helping students achieve higher learning performance, optimizing their use of cognitive resources in learning is vital (Klepsch & Seufert, 2020). The results show that the experimental group rated markedly higher scores in GCL than the control group in each lesson. This finding indicates that the SDP–modeling method evokes students’ GCL by motivating them to allocate more cognitive resources to build and process mental models (Klepsch & Seufert, 2020).
Specifically, in the modeling method, demonstrating each step of the SDP, accompanied by the teacher’s verbal explanation of solutions, seems to be effective for enhancing students’ understanding of the systematic problem-solving process. In addition to showing each problem-solving step and corresponding answers, the teacher explained the logic between these steps and the justifications for error inferences. Allowing students to learn expert information (i.e., ‘why’ and ‘how’ information) can help them acquire useful domain and strategic knowledge and facilitate their schema construction, which helps induce higher GCL (Klepsch & Seufert, 2020; McLaren et al., 2016). These schemata may be activated and serve as a guide for subsequent debugging tasks (Leppink et al., 2014). For example, schemata can direct students on how to devote most of their cognitive resources to processing meaningful debugging steps. However, unlike the experimental group, since the teacher merely showed the error correction process and the final error-repair results, the control group did not have the opportunity to learn expert information, which contributed minimally to schema building.
The scaffolding tool showing the SDP can direct students to concentrate on effective debugging steps in exercises. Scaffolding can guide students to understand problems, hypothesize possible errors based on discrepancies, narrow error searches and promptly undo problematic revisions. By encouraging students to use the recommended steps and strategies (e.g., undo strategy), the scaffolding tool helps them construct schemata to store knowledge in their long-term memory (Van Merriënboer & Sweller, 2005). Such knowledge may be activated in future debugging tasks. Moreover, the scaffolding tool allows students to write down intermediate results (discrepancies, likely errors, correction solutions) on paper. Requiring students to generate and record their own answers may increase their engagement in problem-solving processes (Chen et al., 2015) and help them recognize the relationships between identified discrepancies and corresponding errors and solutions. Additionally, displaying immediate execution results on screen after revisions can help students recognize potential relationships between correction solutions and program outcomes (Kale & Yuan, 2021). The formation of these patterns (e.g., relationships between the discrepancy and likely error, between the error correction and program result) may enhance students’ conceptual understanding and increase their error-reasoning experience. In contrast, owing to the lack of effective debugging strategies, students who solve problems without the help of the scaffolding tool may start debugging based on their intuition and generally rely on weak strategies (e.g., haphazard tinkering, trial and error). This may not be efficient for novices’ learning given that they typically have more difficulties remembering steps and revisions that work and constructing relevant mental models (Van Gog et al., 2019).
The application of the SDP–modeling method promotes schema construction and thus enables students in the experimental group to perceive higher GCL. Students’ schema construction is also reflected in their higher debugging test scores, consistent with the viewpoint that the facilitation of schema building can improve student performance (Klepsch & Seufert, 2020). In addition to increasing students’ learning outcomes, schema construction and automation can decrease ICL induced by debugging exercises. This study indicates that the rating difference in ICL between the two flipped debugging training types was significant in lessons two to four. Moreover, although there was no significant difference in ICL in the first lesson between the two groups, the experimental group taught with the SDP–modeling method had lower ICL in debugging exercises.
Students’ perceived ICL is determined by combining both the complexity of the debugging tasks (i.e., element interactivity) and the students’ relevant prior knowledge (i.e., expertise used for debugging) (Seufert, 2018). The SDP–modeling method encouraged students to organize and store useful information (e.g., SDP, error reasoning processes) in their long-term memory by constructing schemata. This increased their expertise in program debugging (Chen et al., 2015). In subsequent debugging tasks, directly retrieving already constructed task-relevant schemata from their long-term memory helped the students process several associated elements as one (Klepsch & Seufert, 2020). In other words, students with higher expertise process fewer interacting elements (corresponding to task complexity) and thereby experience lower ICL (Seufert, 2018; Thees et al., 2020). In contrast, owing to the lack of guidance on the systematic debugging strategy and the lack of teacher demonstrations, the schema construction process in the unassisted flipped debugging training group is less efficient. This leads to a lack of effective cognitive schemata in students of this group. Thus, the unassisted flipped debugging training group experienced higher ICL in each lesson, and the rating score difference between the two groups increased as the lessons progressed.
Similar to the ICL results, the students who attended debugging training lessons based on the SDP–modeling method perceived lower ECL in each lesson. Moreover, significant differences in the rating results between the two flipped debugging training groups occurred in the last three lessons. For the experimental group, teacher demonstrations (the use of the modeling method) provided the students with clear explanations and expertise in debugging (e.g., systematic steps and correct solutions, error reasoning). Moreover, the ‘how’ and ‘why’ information may obviate novices’ need to use weak debugging strategies in subsequent debugging practice and thus reduce their perceived ECL in learning (Klepsch & Seufert, 2020; Sweller, 2020). Furthermore, to avoid natural teaching behaviors (e.g., demonstrating erroneous solutions inadvertently), the teacher adopted a didactical demonstration approach, such as clearly explaining effective strategies and sequentially displaying each step of the SDP and corresponding correct answers on a slide. This helped decrease the students’ cognitive resources wasted in face-to-face demonstrations.
Additionally, the scaffolding tool used in exercises allowed the students to debug programs based on the systematic steps, which enabled them to avoid unnecessary strategy searches and the use of weak debugging strategies. Moreover, the scaffolding tool relieved the students’ limited working memory by requiring them to write down answers to each debugging step (e.g., discrepancies, likely errors) on paper (Perkins, 1993). Both benefits contributed to the decrease in ECL.
In contrast, in debugging training lessons without the SDP–modeling method, the teacher merely demonstrated error repairs and the final program outcome after repairing all errors. The teacher did not offer the students details on how to infer and locate errors and how to propose correction solutions. Unclear explanations might distract novices and waste their cognitive resources (Van Gog & Rummel, 2010). Additionally, the students did not learn the systematic debugging strategy, and did not have the support of the scaffolding tool in exercises. This means that these novices need to identify appropriate ones among various possible strategies and solutions, which may impose excessive ECL on them (Van Merriënboer & Sweller, 2005). Moreover, owing to the lack of opportunities for learning useful strategic knowledge, these novices tended to rely more on weak problem-solving strategies (e.g., haphazard tinkering, trial and error) in debugging exercises. These neither effective nor efficient strategies can impose high ECL on novices (Klepsch & Seufert, 2020; Van Gog et al., 2006).
Implications for Related Research and Educators
This study shows important implications for relevant research and teaching practices on program debugging. First, this research enriches related empirical studies on program debugging teaching. Empirical research exploring effective instructional approaches concerning program debugging is lacking in CT literature (Michaeli & Romeike, 2019a; Rich et al., 2019). This study helps to fill this research gap. We developed the flipped debugging teaching approach combined with the SDP–modeling method. Moreover, we used a quasi-experimental design with experimental–control groups to examine to what extent the flipped debugging teaching approach combined with the SDP–modeling method can facilitate the learning performance of elementary school students in program debugging and cognitive load. Qualitative data collected (i.e., program debugging tests, cognitive load questionnaire) verified the effectiveness of the flipped debugging teaching approach combined with the SDP–modeling method. This study helps researchers develop an initial understanding of the effective instructional approach relevant to program debugging. This study may also encourage other researchers to refine this flipped debugging teaching approach (using the SDP–modeling method) or implement empirical studies to explore other innovative instructional approaches on program debugging.
Second, this study has essential implications for actual teaching practices. K-12 CT education seldom attaches importance to the implementation of explicit teaching instruction concerning program debugging (Michaeli & Romeike, 2019b). Classroom teachers tend to leave students alone with error-correction tasks or directly give them error-correction solutions due to the lack of appropriate teaching approaches and active learning opportunities for students (Michaeli & Romeike, 2019b). This study demonstrated in detail how to implement teaching instruction in the actual program debugging course in an elementary school to address the issues identified in the related literature (i.e., poor student performance in domain knowledge and strategic knowledge, huge cognitive burdens imposed by debugging learning). Specifically, the flipped classroom method was used to increase active learning opportunities and foster student active participation. The SDP method was used as the scaffolding tool to help novice students get familiarized with the systematic program debugging process to obtain strategic knowledge. The modeling method allowed novice students to observe the whole program debugging process and learn the expertise (e.g., ‘why’ and ‘how’ information) to help them acquire domain knowledge and strategic knowledge (Kale & Yuan, 2021). Moreover, the SDP and modeling methods helped optimize students’ perceived three types of cognitive load. The application of the flipped debugging teaching approach combined with the SDP–modeling method in this study provides a valuable reference to other educators and practitioners. Additionally, our results verify the efficacy of the flipped debugging teaching approach combined with the SDP–modeling method for elementary school students’ program debugging learning, which enriches effective instructional resources relevant to program debugging training.
Conclusion and Limitations
Novices who learn to program are often frustrated by errors (Michaeli & Romeike, 2019b). They generally lack domain knowledge and strategic knowledge used for debugging. Debugging programs can bring a great cognitive burden to novices (Zhong & Si, 2021), given that it is a cognitively demanding task. Novices can rarely improve their debugging skills by merely learning how to program (Fitzgerald et al., 2010). Therefore, effective instructional approaches should be developed and adopted to enhance novices’ debugging skills (Michaeli & Romeike, 2019b) and meanwhile optimize their cognitive load.
This study designed a systematic debugging framework containing four essential steps and examined the effects of applying the flipped systematic debugging teaching approach with the SDP–modeling method on elementary students’ debugging learning and cognitive load. The results of our empirical study proved that the flipped debugging training approach with the SDP–modeling method promotes effective (higher debugging performance) and active (higher GCL) learning among novices compared with the unassisted flipped debugging training approach. Specifically, the application of the SDP–modeling method enhanced novices’ program debugging abilities. Moreover, this debugging training approach encouraged novices to engage in schema construction processes to increase their investment in GCL, which thus helped reduce their perceived ICL. This approach also reduced students’ perceived ECL imposed by learning.
Two limitations that may affect the generalization of this study’s results are as follows: First, only fifth graders were recruited. The results may not be transferable to other grade levels. Future empirical studies should be conducted on different sample groups in junior or senior high schools or even universities to explore how flipped debugging training with the SDP–modeling method affects student learning. Second, the self-report method used for measuring different types of cognitive load needs to be tested in more empirical studies. Future studies should adopt objective measurement methods for yielding more reliable and valid results on students’ cognitive load evaluation. Despite these limitations, considering the importance of debugging skills in CS and CT education and the difficulties teachers encounter in instructional design, this study provides a valuable reference on how to design and implement an effective debugging teaching approach to improve students’ debugging skills and optimize three types of cognitive load.
Footnotes
Declaration of Conflicting Interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.
Funding
The author(s) received no financial support for the research, authorship, and/or publication of this article.
