Edinburgh Research Explorer The relationship between Executive Functions and Computational Thinking

We argue that understanding the cognitive foundations of computational thinking will assist educators to improve children’s learning in computing. We explain the conceptual relationship between executive functions and aspects of computational thinking. We present initial empirical data from 23 eleven year old learners which investigates the correlation between assessments of programming and debugging in the visual language Scratch and scores from the BRIEF2 assessment of executive functions. The initial data shows moderate to large correlations between assessments of debugging and programming with the BRIEF2 teachers’ rating of executive function as manifested in classroom behaviour. Case studies from the empirical data are used to qualitatively illustrate how executive functions relate to a game making task. We discuss the implications of these findings for educators, and present suggestions for future work. pattern algorithmic of of control; structured problem iterative, recursive, and parallel thinking; conditional Our findings a standardized test of EF and analysis of the code by with their are metacognition when Allsop’s study in as well as to examine the and used and Allsop’s methodology gives some insight into thought beneficial, our case the use of standardized tests of EF alongside the assessment of programming enabled us to investigate the relationship between EF and CT. research examine the impact of MC in the emerging EF-CT relationship.


Introduction
The recent Royal Society report on computing education in UK schools reviewed the landscape after major curricular reform in which computing lessons became a requirement for learners aged 5 and older in England and Wales (Royal Society, 2017). While it welcomes the changes (which it was partly responsible for instigating) and notes that there are pockets of excellence, it identifies that computing education is still "patchy and fragile" (Royal Society, 2017, p. 6). The report demonstrates the curriculum changes are not enough; they must be supported by high quality teacher education and computing education research. It proposes that a research agenda in the UK should focus on the questions: "What is the most effective, best-evidenced curriculum framework for computing? …Which specific instructional techniques and teaching strategies are most effective for raising attainment in computing?" (Royal Society, 2017, p. 95). These are also open questions within the international research community. In order to answer these questions, however, we need to further develop our understanding of the cognitive and psychological skills which underpin different aspects of computational thinking, and how these develop throughout childhood. This paper focuses on the potential link between computational thinking and underlying executive functions.
Much work has been done on defining computational thinking (also referred to as CT) and its component skills. In this paper, we use the Royal Society's clear and succinct definition of computational thinking: " the process of recognising aspects of computation in the world that surrounds us, and applying tools and techniques from Computer Science to understand and reason about both natural and artificial systems and processes" (The Royal Society, 2012, p. 12). A review of computational thinking research identified the following core computational thinking elements: abstractions and pattern generalizations (including models and simulations); systematic processing of information; symbol systems and representations; algorithmic notions of flow of control; structured problem decomposition (modularizing); iterative, recursive, and parallel thinking; conditional logic; efficiency and performance constraints ; debugging and systematic error detection (Grover & Pea, 2013). In addition, "programming is not only a fundamental skill of CS and a key tool for supporting the cognitive tasks involved in CT but a demonstration of computational competencies as well." (Grover & Pea, 2013, p. 40) There has been debate about the extent to which computational thinking can be distinguished from the other sorts of thinking which children learn at school. Although historically some doubt has been cast on the nature of the relationship between programming and problem solving (Palumbo, 1990), recent evidence synthesis reveals that learning to program can improve scores on other measures of problem solving. A meta-analysis of studies which explore the transfer of programming skills to general problem solving found an overall transfer effect of g =0.49, with a transfer to mathematical reasoning of g=0.57 (Scherer, Siddiq, & Sanches Viveros, 2018). It is also likely that programming and other computational thinking abilities are enabled by well-researched lower level psychological processes. Grover and Pea make the case that while there might be overlap between computational thinking and other STEM problem solving approaches, it was recognisably and crucially absent from previous curricula (Grover & Pea, 2013). Recent empirical work supports this; while computational thinking is predicted by other cognitive abilities, it appears to some extent to be an independent construct. In a study of 1251 Spanish school students, Román-González and colleagues investigated the relationship between computational thinking (as measured by their CTt instrument) and other cognitive abilities as measured by the Primary Mental Ability and RP301 Resolucion-de-Problemas problem solving standardised psychological tests (Román-González, Pérez-González, & Jiménez-Fernández, 2017). They found a high correlation (r=0.67) between general problem solving ability and computational thinking scores. In a regression model, spatial ability and logical reasoning as measured by RP30 problem solving tasks were significant predictors of the CTt scores, explaining 27% of the variance. The authors interpret the high proportion of unexplained variance to suggest a "certain independence of CT as a psychological construct, distinct from the traditional aptitudes" (Román-González et al., 2017, p. 9). They recommend that further research should relate computational thinking with other cognitive abilities including working memory and other executive functions (also referred to as EF). This paper pursues this line of research by exploring the relationship between two important aspects of computational thinking (programming and debugging) and executive functions. It begins with an explanation of executive functions, the role they play in academic success, and the reasons why they are likely to be related to computational thinking. This is followed by an account of how executive functions (as measured by the Behavior Rating Inventory of Executive Functioning-2 (BRIEF2) instrument) may map to creative programming and debugging. Having made the case that specific EF skills are likely to underpin these aspects of computational thinking, the paper then reports on an empirical study to investigate this issue. Data on 23 eleven year-old learners' creative programming and debugging performance, and EF abilities was gathered. Results of a correlation analysis do indeed support the case that EFs are related to computational thinking. Case studies from the empirical data are used to qualitatively illustrate how executive functions relate to a game making task. The paper concludes with some recommendations for practitioners about how this might affect classroom decision making, and suggestions of future research work.

Executive Functions and the Link to Computational Thinking
Executive functions (EF) is an umbrella term for higher order cognitive functions linked with the frontal lobes of the human brain (Aron, Robbins, & Poldrack, 2004) and include abilities such as inhibiting impulsive responses, the ability to hold and simultaneously manipulate information in mind (known as working memory), attention shifting (or cognitive flexibility), planning and risk taking (Diamond, 2013;Miyake et al., 2000). EF serve as general purpose control mechanisms that help modulate human cognition (Miyake et al., 2000), underpin self-control (Denckla, 1996;Pennington & Ozonoff, 1996) and are commonly implicated in problem-solving or goal-directed-behaviour (Luria, 1966). These functions mature at different rates through childhood and into adolescence (Dolan & Molen, 2006).
Executive functioning and educational attainment in the primary school age-range has also been linked with metacognition (MC) (Bryce, Whitebread, & Szűcs, 2015), with some studies reporting a link between MC and problem solving in computer science learning specifically (Allsop, 2019;Parham, Gugerty, & Stevenson, 2010). Parham and colleagues' analysis of a think-aloud study with eleven college-level programmers indicates that the meta-cognitive strategies of checking/comparing code and stating/revisiting goals were commonly used mental processes. In a study of a class of 11 year learners, Allsop noted the use of metacognitive practices to control and regulate programming activities including planning, monitoring and evaluation (Allsop, 2019). Whilst related constructs in children's thought and action (Lyons & Zelazo, 2011), EF and metacognition have been based in different research and theoretical traditions in the psychological literature (Roebers, 2017a). In this study, for the sake of clarity, we have chosen to focus on EF.
We believe that the link between EF and CT is worth exploring for two reasons: 1) EF is a predictor of academic success in general, including in the development of mathematical skills and science learning  so it is reasonable to assume that they are also required in CT; and 2) conceptual analysis of the processes involved in programming and debugging predict that cognitive regulation aspects of EF are required. However, further empirical evidence of the relationship is required; this paper makes an initial contribution by providing the results of an exploratory study in a primary school classroom.
Programming and debugging are not the only components of computational thinking; it is likely that EFs are also implicated in other aspects. We have chosen to start with these components because they are commonly taught in classrooms in the UK and other countries internationally, and there are extensive online teaching materials to support them. Other aspects of computational thinking should be the subject of future research.

EF as a Predictor of Academic Success
Executive functions are implicated in a wide range of areas of academic learning and attainment. For example, in reading (Altemeier, Abbott, & Berninger, 2008), maths (Gilmore et al., 2013) and science (St Clair-Thompson & Gathercole, 2006). They are also predictive of school achievement more generally (Bull & Scerif, 2010;McLean & Hitch, 1999;St Clair-Thompson & Gathercole, 2006;Titz & Karbach, 2014) as well as university achievement (Knouse, Feldman, & Blevins, 2014), and job success (Daly, Delaney, Egan, & Baumeister, 2015). Some interpret these findings to suggest a domain-general relationship between EF and school attainment (Best, Miller, & Naglieri, 2011), a growing number of studies highlight a particularly important role for EF in relation to learning in STEM subjects (St Clair-Thompson & Gathercole, 2006;Van der Ven, Kroesbergen, Boom, & Leseman, 2012), although to our knowledge, no previous studies have considered the relationship between EF and CT.
Neuroscience and education research indicates that executive skills play a critical role in developing mathematical proficiency, particularly updating and manipulating working memory, inhibition and shifting . Given Weintrop and colleagues' detailed argument exploring the reciprocal relationship between computational thinking and maths and science learning (Weintrop et al., 2016), and the meta-analysis results which indicate programming improves mathematical test scores (Scherer et al., 2018), there is good reason to investigate the relationship between computational thinking and executive skills. The executive skills which support the development of maths proficiency are also likely to play a role in developing computational thinking. Indeed, empirical evidence from design based research with middle school children confirms that the outcomes of a course in computational thinking were predicted by maths performance ( Grover, Pea, & Cooper, 2015).

Why Efs Are Required For Creative Programming Tasks
The playful constructionist approach advocated by the Scratch creators, based on Papert's intellectual legacy, encourages creativity and self-directed exploration. Following the footsteps of Logo, Scratch was designed as a constructionist environment to support a spiral of creativity, in which learners "imagine what they want to do, create a project based on their ideas, play with their creations, share their ideas and creations with others, and reflect on their experiences-all of which leads them to imagine new ideas and new projects" (Resnick, 2007, p. 18) . Brennan and Resnick describe design in the creative programming context as "an adaptive process, one in which the plan might change in response to approaching the solution in small steps". They describe a process of "iterative cycles of imagining and building, developing a little bit, trying it out then developing further, based on their experiences and new ideas." (Brennan & Resnick, 2012, p. 7).
The merits of pure discovery learning (for example in Papert's constructionist work with Logo) have been questioned (Mayer, 2004). Previous researchers have argued that "learners often struggle with algorithmic concepts, especially if they are left to tinker in programming environments, or if they are not taught these concepts using appropriately supportive pedagogies." (Grover et al., 2015, p. 205). That is, unstructured programming tasks by themselves may not improve computational thinking. Grover et al. recommend minimally guided discovery learning for computational thinking courses for middle school learners (Grover et al., 2015), including approaches such as scaffolding, cognitive apprenticeships, code reading and tracing, and modelling the process of decomposition. They aim to enable children to build on computational concepts which they have been taught, in a way which fosters creativity and ownership.
The complexity of creative programming tasks can greatly challenge novices. The individual computational thinking skills can be difficult to acquire in themselves, but the higher order executive function skills place additional load on the learner, particularly in terms of planning and self-monitoring. The learner must decide what to make, how to make it and be able to monitor her own progress in reaching her goals. Depending on the stage of the learner, it may be the case that the requisite planning and monitoring executive functions are still developing. In addition, the task places a load on working memory because the programmer must hold in mind the end goal, and steps needed to achieve the goal. Inhibition is also required to avoid distractions from the goal.
Papert (Papert, 1991) and later Resnick and Brennan (Brennan & Resnick, 2012) favour a less top down approach to planning in which the programmer is: "guided by the work as it proceeds rather than staying with the pre-established plan" (Papert, 1991, p. 3). A learner working in this way would still task-monitor periodically to evaluate whether the current code produces a desirable output, and if not, decide what changes are needed and map out the sub-steps to get from the current state to the desired state. While open ended creative tasks can be fun when appropriately challenging, it may be overwhelming and frustrating for some learners unless they are adequately supported. For learners with developing EF skills, it may be difficultand demoralisingto engage with such tasks. With appropriate support with planning and monitoring, however, working on motivating programming tasks may be one approach to EF skills development. It is possible that the requisite EF and programming skills can be further developed alongside each other in creative projects, if the learner has previously had support to develop both programming skills and planning and monitoring skills in other contexts.

Why EFs Are Required For Debugging Tasks
Resnick and Brennan describe computational practices relating to solving and anticipating problems. An interviewee described her debugging activities as "identify the source of the problem, read through the scripts, experiment with scripts, try writing scripts again, find example scripts that work, tell or ask someone else, take a break…" (Brennan & Resnick, 2012, p. 7). Rich and colleagues present a helpful literature syntheis and learning trajectory of debugging for children (Rich, Andrew Binkowski, Strickland, & Franklin, 2019). They identify strategies documented in the literature for finding and fixing errors including: hypothesising and testing theories about the cause of a problem, and deciding how to change a program when it does not produce the intended results. These behaviours are likely to rely on underpinning executive function capacities such as working memory and cognitive flexibility ("the ability to shift between response sets, learn from mistakes, devise alternative strategies, divide attention, and process multiple sources of information concurrently" (Anderson, 2002, p. 74)). Rich et al. observe that emotional regulation and the ability to preserve in the face of failure is a requirement for successful debugging; emotional regulation is an aspect of executive function which is assessed by the emotional control subscale within the BRIEF2 instrument which we used in this study. In addition, Rich and colleagues note that at the end of the learning trajectory, learners become aware that debugging techniques can be chosen strategically. The ability to evaluate and slect the best strategy for a task requires well developed executive function capacities (Roebers, 2017b).
In order to systematically detect errors in code, the learner must have the ability to understand the decription of the incorrect program behaviour and why it is different from the required behaviour, and be able to develop and follow a plan of detecting, fixing and testing which places high demands on working memory, as well as the ability to switch between tasks and switch back and forth between different representations. This last point is particularly salient in a visual language like Scratch where the user must look at the visual behaviour of a sprite on screen, compare it to a mental representation of what the ideal behavior would look like, and then switch to a different visual representation of code blocks in order to fix the problem.
The programmer must think of possible reasons why the program is not working, prioritise which is most likely to begin with, pinpoint where the error would occur in the code, identify whether it is actually present in the code and if so, fix it. If that particular error was not present, or if it was present but fixing it did not result in the target code behaviour, the programmer must move on to consider another possible reason for the flaw. Beginner programmers are disadvantaged because they do not have the experience to quickly identify or prioritise possible errors. From this point of view, the debugging exercises used in this study were designed to start with examples where the learner need only solve one bug at a time and progress to finding and correcting multiple bugs.

A Classroom Study
We conducted an initial study with a class of 11 year old children to begin the process of testing the theorised link between EF and CT with empirical data. The aims of the study were to quantiatively explore the relationship between EF and CT, specifically: the overall relationship between creative programming and debugging with aspects of executive function, as measured by BRIEF2. A further goal for this study was to use case studies from the empirical data to qualitatively illustrate the relationship between EF and CT.

Participants
This study involved twenty-five children (16 boys, 9 girls) aged 11-12 years from the same Primary 7 class at a Scottish Primary School. All children had experience of programming using Scratch as part of their computing curriculum work. The group were recruited by their class teacher and received written information sheets and consent forms (in age appropriate language) two weeks before the study to be read, signed, and returned before they could take part in the sessions. The ethical procedures were approved by the [blank for review] ethics committee. Of the twenty-five children who gave their consent to be part of the study, we were able to collect data on all EF/CT measures for twenty-three.

Data Collection
The following data was collected in this study.

Executive functions
The Behavioural Rating Inventory of Executive Function (BRIEF2) is a rating scale used to assess everyday behaviours associated with executive functions at home and school. It is considered to be an ecologically valid method of assessing the extent to which individuals are able to successfully pursue their own goals in complex every-day problem solving tasks (Toplak, West, & Stanovich, 2013) . It is used for clinical assessment of children for whom there may be concerns about self-regulation (e.g those with autistic spectrum disorders, attention disorders, depression and other conditions). The BRIEF2 is a questionnaire completed by teachers about individuals' behaviour and emotional regulation, aspects of EF which are also important for classroom learning. A recent review of BRIEF2 considered it to be a theoretically and psychometrically sound measure of executive functioning for children and adolescents (Dodzik, 2017), with internal consistency for the teachers form in the range of alpha coefficient =0.88 to 0.98, and a test/re-test reliability of 0.82.
In this study, the BRIEF2 teacher rating scale is used to assess behaviours which might impact on typically developing children's ability to complete complex creative programming and debugging tasks. BRIEF2 has three indices: behavioural regulation (consisting of inhibit and self-monitor scales), emotion regulation (consisting of shift and emotional control scales) and cognitive regulation (consisting of initiate, working memory, plan/organise, task-monitor, and organisation of materials scales).
The class teacher filled in a 63 item scale for each pupil, indicating whether the statement is true of the child never (scored as 1), sometimes (scored as 2), or often (scored as 3). The raw score was then converted to a T-score which is normalised for age and gender according to. T-scores range between 36 and 90 for 11-13 year old girls and between 37 and 88 for 11-13 year old boys (Gioia, Isquith, Guy, & Kenworthy, 2015). Higher scores indicate higher level of difficulty in a specific domain of executive function. The Global Executive Composite score is reported here as it is considered as a useful summary measure.
Creative programming task: We used an automatic assessment of aspects of computational thinking as manifested in the source code of a Scratch program collected from the participants (flow control, data representation, abstraction, user interaction, synchronisation, parallelism and logic). The code was analysed using Dr Scratch, software which performs static analysis of Scratch source code (Moreno-León & Robles, 2015). Assessment from Dr Scratch has shown to be consistent with other software metrics of code complexity (Moreno-Leon, Robles, & Roman-Gonzalez, 2016) and correlate strongly with the assessments of expert human evaluators (r=0.82) (Moreno-León, Harteveld, Román-González, & Robles, 2017). Overall scores range between 0 and 21, with higher scores indicating higher proficiency.
Debugging task: A set of 7 custom Scratch debugging tasks were developed by the authors, based on the Debug It! Exercises available on Scratch Studio 1 . The seven exercises required debugging examples involving conditionals, fixed loop, variables, conditional loop, parallelism (simple problems), and two integrated examples which brought together several of these concepts (complex problems). Participants were given a specification of what an example Scratch program should do, a description of the buggy behaviour of the code when it runs, and the code itself. They were then asked to locate and fix the error. Each simple problem was scored with 2 points for a complete solution, and one point for a partial solution (where a clue had been given), while the two complex problems which had a maximum score of 6 points because there were multiple bugs. The maximum overall score was 22, with higher scores indicating higher proficiency. The tasks were scored by the first and second authors; discrepancies in the scores were resolved through discussion.

Procedure
Data collection sessions were undertaken by the second author and a research assistant at the Primary School. These staff members both had up-to-date certification to work with children.

Scratch Creative Programming Session
The creative programming sessions were hosted in the children's classroom using school Windows laptops and facilitated by the second author. He first explained to the children that they were being asked to use Scratch online to individually create a program of their choosing within a 60-minute time limit and gave the children an opportunity to ask questions about the exercise. The children had a written document of a description of the task and instructions to refer to and could ask for clarification and assistance if required.

Scratch Program Debugging Session
The debugging session was again facilitated by the second author but the research assistant was also present to help support the children. The session began with the second author explaining to the children that they were being asked to fix a series of 7 broken Scratch programs within a 60-minute time limit. The children were asked to work alone without discussion.
The children were given a worksheet with a description of each problem, stating what the program should ideally look like (the specification) and the problems with the current version of the program (see supplementary materials). The children also had access to videos of the ideal of each program and the problematic version.

Descriptive Statistics
The descriptive statistics indicate that this class of children had room for improvement in debugging (with an average just slightly over half marks) and creative programming (with a mean under half marks). Note that the number of participants N varies due to student absences on different data collection days. The pearson correlation between the Creative Programming task score and the Debugging score is r=0.6 (95% CI 0.26, 0.82]). This can be interpreted as a large correlation between these two measurements of computational thinking (Cohen, 1992).

Findings
As shown in Table 3, programs which have higher Dr Scratch scores are produced by children who have lower BRIEF2 scores (i.e. those who have more mature executive functioning): BRIEF2 scores explain 60% of the variance in Dr Scratch scores. Similarly, learners with a greater level of debugging skills have better developed EF skills, explaining 40% of the variance in debugging scores. Focusing on how the Scratch score relates to the BRIEF2 sub-scales, the Behaviour Regulation Index (BRI) correlates with r=-0.69, the Emotional Regulation Index (ERI) correlates with r=-0.57, and the Cognitive Regulation Index (CRI) correlates with r = -0.55. Given that the BRI seems to have the strongest relationship with the Scratch score, it was worth examining the relationship of the further subscales within it: the Inhibit subscale is r=-0.7, and the Self-monitor subscale is r=-0.67. The definition of Inhibit from the BRIEF2 manual is "the inhibit scale assesses inhibitory control (i.e. the ability to inhibit, resist, or not act on impulse), including the ability to stop one's behaviour at the appropriate time." (Dodzik, 2017, p. 33). The definition of Self-monitor is "the self-monitor scale assesses awareness of the impact of one's own behaviour on other people and outcomes". It includes "awareness of one's own effectiveness in problem solving and the ability to monitor important outcomes" (Dodzik, 2017, p. 34).

Qualitative Illustrations of How EF Relates to Programming Tasks
It is instructive to examine the games produced by learners with different EF profiles in order to identify sorts of help which teachers could provide when supporting similar tasks in the future (see Table 3 for a summary of their numerical scores). P18 is an eleven year old boy with one of the highest Behavioural Regulation Index scores in the class, scoring highly on both the inhibit and self-monitor scales indicating serious issues with these areas of functioning. Indeed, P18 has extremely elevated EF profiles across all BRIEF2 subscales. This learner's Scratch file has no code. It is hand-drawn stick man sprite and some vertical black lines on a backdrop. It is possible that the black lines were intended to form a maze like some of the other children's. The game does not convey personal interests or show exploratory behaviour within the tool like some of the other games with very little functionality. This learner has an elevated score in Initiate, suggesting that he finds it difficult to get started on a task. P18 scored 7 out of 21 on the debugging test, which illustrates that he has some basic understanding of Scratch constructs but he was unable to put them into practice. He was unable to marshall his efforts to produce a plan for a meaningful program in an open ended creative task. This learner would benefit from being given a specific task which would consolidate his knowledge of the Scratch concepts which he has been taught. Figure 1. A Screen Shot of P18's Game Figure 2 shows a screen shot of P9's game. P9 is also an eleven year old boy with an elevated EF score across all the subscales and was joint with P18 in having a particularly high score for the self-monitoring scale again, indicating difficulties across numerous areas of EF. In this game, there a multiple copies of each sprite with the same code copied between sprites. When the code runs, the sprites rapidly rotate and make a noise. The overall effect is strikingly colourful and overwhelming. There is quite a lot of code, but it is repeated sequences of animation instructions and loops which do not serve a clear purpose. There are multiple unnecessary nested loop constructs which suggest that the learner does not understand that only one forever block would have caused the cat sprite to repeatedly miaow. The learner does not appear to have been following a plan to create a particular interactive program, but rather gives the impression of exploring the Scratch interface to produce an entertaining visual result. He was absent on the day of the debugging session so there is no additional information about his Scratch knowledge. While children often find it fun to experiment with visual effects in Scratch when they initially encounter it, this learner would benefit from support in developing a specific goal and identifying how this could be accomplished in Scratch.

Figure 2. A Screenshot of P9's Game
As an example of a child who did have a plan but who did not write any code, P5 made a backdrop which reads "in this game you have to get your green ball to the yellow ball and you will progress to the next round". This is a plan for a potentially entertaining game, but it has not been implemented at all, with no sprites representing either colour of ball. His debugging score of 8 suggests that he understands how Scratch concepts work although he did not use them in his own game. P5 is in the 59% percentile for his overall EF score, but he has an extremely elevated score for Inhibit which indicates that in general he is distractable and may be diverted from executing plans.
In the case of P1, a twelve year old girl, there is an indication that she thought of a plan but did not prioritise finishing the subtasks which were essential for the user to play the game. According to the instructions for the user, the purpose is to jump up and collect apples from a tree. The event handling code to implement this is not present, although the learner spent time creating scene changes to transfer from a bedroom to an orchard and back. P1 has a mid-range EF score in general, but it is elevated for the Shift subscale. Shift includes the ability to switch or alternate attention and change focus from one topic to another. Here, the learner may have failed to switch attention to the apple gathering mechanic in time to complete the game. The game would have been more successful if the learner had some support in identifying which aspects were essential to get a working prototype of the game completed.
P11 (an eleven year old girl) has developed a plan for her game although her knowledge of Scratch appears to be insufficient to put it fully into practice. P11 has low scores for EF, benchmarked in the 26th percentile for a girl of her age according to the BRIEF2 manual indicating no substantive difficulties with EF in comparison to peers. In the game, there are clear instructions which tell the user to hunt for the apple in each scene. There are multiple scenes, and multiple sprites for decoration. Code is copied across sprites but is not relevant to them. The code does not work because when the user clicks on the apple it switches to only one other room. There is also redundant code with "if" statements which will never execute. Her debugging score of 5 also suggests that her knowledge of Scratch concepts could be improved. In this case, the learner could progress with some support in learning conditional language constructs to help her achieve her initial plan.

Figure 3. A Screen Shot of P11's Game
Like many of the children, P17 (an eleven year old girl) made a maze game (see Figure 4) but it is unusually well executed. P17 has low EF scores indicating no difficulties in EF (in the 23rd percentile) and her debugging score of 8 indicates that she has some working knowledge of Scratch constructs. The maze game has several levels of progressing difficulty implemented, indicating some advance planning of the maze features. The code is concise and elegant in comparison to that of her peers, using broadcast to generically level up. A step forwards for this learner might be to try implementing more complex game mechanics such as a scoring mechanism which would require additional computational thinking skills.

Discussion and Future Research
Initial empirical results suggest that there is a relationship between EF and both creative programming and debugging. This is consistent with the recent finding that computational thinking assessments correlate with general cognitive abilities (r= 0.67) . We do not interpret this to mean that CT is just "ordinary" problem solving and that the current worldwide emphasis on developing CT is mistaken. Rather, we see it is one step further in establishing the nomological net  which links CT to other cognitive variables.
The case studies give an indication of how programming skills and executive functions are both required for learners to be successful in open ended creative programing tasks. Our study suggests EF is linked with the CT abilities of children but metacognition (in terms of self-regulation and self-monitoring) may also contribute to the ability of children to engage in CT. Our findings from a standardized test of EF and analysis of the code produced by the children along with their debugging performance are complementary to previous evidence about children's metacognition when programming. Allsop's study in a primary school classroom (in a similar educational context and age group) triangulated evidence from semi-structured interviews, learner journals, observations as well as completed games to examine the planning, monitoring and evaluation skills used by the children (Allsop, 2019). As with our case study learners, Allsop found that debugging required a degree of skill in monitoring and evaluation. Interestingly, the learners in her study reported that their methods of planning their games (such as sketching) transferred into their ability to plan for other learning domains. Allsop's methodology gives some insight into the children's thought processes which is beneficial, although in our case the use of standardized tests of EF alongside the assessment of programming enabled us to investigate the relationship between EF and CT. Future research could further examine the impact of MC in the emerging EF-CT relationship.
An important finding from Allsop's work is that the children in a natural classroom setting used language as an instrument for making decisions, evaluating and regulating activities in conversation with their peers. This suggests that attempts to objectively assess individual performance on creative programming and debugging in a "test" situation where peer collaboration does not occur may underestimate the children's capabilities. That is, Scratch code and debugging scores from "test" conditions reveal what the learner is capable of without the assistance of a more able peer, whereas more naturalist methodologies show what the learner is able to do within their zone of proximal adjustment (i.e. the human and artefact resources that are the most appropriate form of assistance for a given learner at a particular moment in time (Luckin, 2008)).
As this was exploratory work, further studies are required to confirm these findings, and establish the direction of the effect. This study should be replicated with a larger sample size to establish whether the relationships between these variables hold. While the automated assessment of Scratch programs using Dr Scratch is convenient, hand analysis of the games suggests that there are discrepancies between the inclusion of a code construct and its correct usage. Future versions of Dr Scratch may address such problems such as the inclusion of "dead" code which is never used.
There have been recent calls for improvements in standardised methods for assessing computational thinking . This study focussed on programming and debugging, by analysing the product of these processes (program source code). Future work could use assessments of wider computational thinking skills, perhaps using tools such as the CTt . We would anticipate that individual test items would be shorter and they would require less sustained concentration on a single problem than an open-ended programming tasks.

Implications for Educators
The results of this pilot work may be of benefit to classroom teachers who are planning how to support their learners during Scratch projects. It would appear that learners who have difficulties with executive functions, particularly behavioural regulation (including not being able to successfully self-monitor or inhibit their behaviour) could find an open creative task challenging. For such learners, it could be beneficial to introduce a variety of support mechanisms for a zone of proximal adjustment (Luckin, 2008). The teacher could introduce regular check points where each class member reflects (perhaps with a classmate) on the extent to which they have achieved their initial plan. Some learners may need help to come up with a coherent plan in the first place (beyond exploring the interface to find serendipitous effects), and could potentially benefit from lessons in structuring and prioritising the required steps to achieve an initial game idea. This can be scaffolded through activities in which the learners devise a plan to implement a given specification, or are asked to prioritise a list of tasks which need to be achieved to make a specified game.
Other learners in this study appeared to have the executive skills to conceive, execute and monitor a plan but lacked the knowledge of programming language constructs to carry it out. A possible remedy for this would be to recommend project specifications to learners to develop their current level of Scratch knowledge e.g. a learner who has successfully implemented a maze game could be encouraged to try developing a scoring system for it once they have studied a lesson on variables.
While teachers are skilled in scaffolding tasks according to learners' stages for other areas of learning, they may find it harder to achieve if they are themselves new to programming and have not yet developed an intuition for how difficult tasks are to achieve in the target programming language. This emphasises the need for learning materials which are clearly graded in terms of computational thinking difficulty.
If future work was to confirm a strong relationship between EF and aspects of CT, what would be the implications? Firstly, it would be useful for those designing curricula and teaching materials for CT, because previous empirical results about the developmental trajectory of EF would give some guidance of the stage at which it would be appropriate to introduce particular problem solving tasks in CT. Well established empirical results about the development of the ability to look ahead when planning, the development working memory and shifting could be applied. These could be used to design external representations, software scaffolding or pedagogical approaches which would assist learners whose EFs are still developing.
Secondly, knowledge of how certain types of CT task rely on secure EFs could help teachers to plan tasks which are appropriate to their learners. Research into teachers' knowledge of executive functions in mathematics learning illustrates that experienced teachers are aware of the importance of working memory, inhibition and shifting from observation during their practice . However, Gilmore and Cragg found that it may take some years for this understanding to develop and student teachers may not encounter these concepts during their studies. It is therefore important that developers of classroom learning materials think carefully about the executive function demands of their programming and debugging activities and indicate clearly the stage of learning for which each task is suitable. Plain language indications of the underlying skills would also be helpful (such as the statements used in the BRIEF2 tool), as Gilmore and Cragg found that even the experienced teachers who understood the concepts were not familiar with the technical terms from the psychology literature. An introduction to EF and how it relates to CT could be a useful part of initial teacher education programmes.
Lastly, it is possible that CT activities could be a motivating and engaging way to help learners improve their EFs. Because EF is a predictor of life success, academic success and health in later life, interventions which successfully improve EF in young learners are very valuable (Diamond, 2012). Attempts to train EFs (such as working memory) in isolation have shown limited effectiveness when transferred to improving maths proficiency (Titz & Karbach, 2014). More holistic curriculum based interventions have met with more success, for example Diamond's model of the routes to developing EF emphasises the importance of joy; social belonging and support; and the building of confidence, pride and self-efficacy (Diamond, 2012). The design goals of the Scratch community are strikingly similar (Resnick et al., 2009), with the emphasis on fun, low floor, high ceiling and wide walls (as a route to building confidence and pride in achievements), and a large online community for sharing and support1. For these reasons, practice during motivating, authentic and appropriately challenging computational activities could be a rich environment in which to develop the executive functions which will be crucially important to children's lives.