1. Introduction
Computational thinking involves a process of problem solving by applying basic knowledge of science, technology, logic, and mathematics [
1,
2]. The term emerged from Papert’s [
3] work on constructionist programming environments based on design and algorithm-based problem solving. It is a form of emergent literacy that seeks to foster the learning of programming progressively, using basic computer coding principles. In this approach, students at different educational levels create sequences of instructions and algorithms to control the actions of an object in a virtual or physical space. For Want et al. [
4], the development of computational thinking involves various skills and abilities, such as organising and logically analysing information, identifying, investigating, implementing possible solutions, etc. while strengthening algorithmic thinking.
Algorithmic thinking is a fundamental problem-solving skill, which involves devising a step-by-step solution to address a given problem. Bers et al. [
5] state that, unlike coding, which refers to the technical skills needed to write code in a specific programming language, algorithmic thinking focuses on the conceptual process of designing an algorithm. Along these lines, for Selby [
6], algorithmic thinking is distinguished from coding and is considered an independent skill prior to coding. It involves the ability to plan and organise the actions needed to solve a problem sequentially and effectively. These skills are considered important elements of computational thinking and are fundamental in the development of programming and computational problem-solving skills [
7,
8].
There is a broad consensus about the close relationship between computational thinking skills and programming. Different authors [
9,
10] argue that computational thinking has provided a new logical framework for teaching programming. Computational thinking involves a set of cognitive and problem-solving skills that are fundamental to the field of robotic programming. These skills include breaking down complex problems into simpler steps, identifying patterns and regularities, designing algorithms to solve problems, and the ability to think in a logical and structured way. Programming, in turn, provides a practical platform for students to exercise and apply these computational thinking skills in solving specific problems.
Existing studies have shown that learning and practising robotic programming contributes significantly to the development of computational thinking in students [
11,
12]. By participating in programming activities, learners are challenged to analyse and understand how computer systems work, to identify and resolve bugs, and to improve their solutions. These experiences foster skills such as logical reasoning, abstraction, creativity, and collaboration, which are fundamental to both computational thinking and programming [
13]. Recently, Su and Yang, in their extensive review of the literature on computational thinking, concluded that the abstraction and generalization of patterns, the systematic processing of information, and the decomposition of the structure of problems, among others, are basic elements that are integrated in computational thinking and should be part of the curriculum, given their cognitive contributions [
14].
The development and improvement of computational thinking associated with robotic programming have undergone a growing evolution in recent years. However, it is true that this progress has not had the same impact on women as on men and that there is a certain disparity in interest in robotic programming between the two groups. It is important to recognise that this situation may be influenced by cultural factors and socialisation processes experienced from childhood that may motivate men more than women to get involved in these fields [
15].
Along these lines, gender stereotypes may have been constructed by associating science, technology, engineering, and mathematics (STEM) with masculine characteristics. For Chan [
16], these stereotypes may create barriers and disincentives for women to explore and actively participate in these sectors. Furthermore, as Charlesworth [
17] points out, the gender roles and expectations that are transmitted in society can also influence people’s choices and preferences from an early age. It is therefore essential to promote gender equality in science and technology fields as well as in the development of robotics programming. This implies fostering inclusive and equitable education that provides opportunities and resources for all people to expand their interests and skills in these fields, regardless of their gender [
18].
Strong computational thinking skills can be a motivating factor for students to be interested in STEM-related careers. However, it is not currently integrated into curricula in a broad and systematic way like other subjects such as mathematics or science [
19,
20]. The lack of a specific curriculum that lays the foundations for computational thinking from an early age represents a challenge in education. There are few models or approaches that highlight computational thinking in current educational practices [
21]. Despite the importance of computational thinking, little attention has been paid to its development in the training of future teachers. Most research and experiences prioritise its teaching at the compulsory secondary education stage [
12], leaving a gap in the training of future teachers.
However, there is a European and worldwide trend to introduce computational thinking into the curriculum. For example, in Spain, some institutionalized initiatives have been developed for the incorporation of computational thinking in both primary and secondary education [
22] such as the School of Computational Thinking and Artificial Intelligence created by INTEF [
23], which is aimed to explore the possibilities of computational thinking and Artificial Intelligence for learning in the classroom. To achieve this goal, they have created different educational and training resources for interaction in non-university classrooms. In addition, there is a national effort to include computational thinking in subjects related to technology and computer science. However, it is likely that students who do not attend these subjects will not have access to the benefits that computational thinking can bring them [
24]. For this reason, the measures taken at the national level for the integration and development of computational thinking are mainly focused on infant, primary, and secondary education. At the university level, to the best of our knowledge, there are no unified and institutionalized measures for the development of computational thinking.
To address this situation, it is necessary to promote greater integration of computational thinking in the training of future teachers. This implies the incorporation of content and methodologies related to computational thinking in teacher training programmes, as well as the development of appropriate resources and materials for its teaching [
25]. It is also important to take into account the level of computational thinking that students possess. Carrying out diagnostic assessments to find out their level of competence in this area can help to identify areas for improvement and adapt training actions according to the needs of each group of students. In addition, it is important to consider variables such as gender and previous experience in robotics programming, as they can influence the development of computational thinking [
26]. This will allow for more tailored and inclusive training actions.
Along these lines, several studies have addressed the relationship between students’ computational thinking skills and gender, as well as with previous experience in robotics programming. Thus, the work carried out by Atmatzidou et al. [
27] showed that there are no significant gender differences in the development of computational thinking skills among students aged 15–18 years who participated in an Educational Robotics programme. The same holds for the studies conducted by Bati [
28] and Kanaki et al. [
29] with infant education pre-service teachers. These findings suggest that gender does not significantly influence the development of these skills in these contexts. Master et al. [
30] found that elementary school students with programming experience reported higher technical interest and self-efficacy compared to those without robotic programming experience.
In short, most of the current studies that have focused on analysing gender and programming experience in relation to computational thinking have been conducted on students at non-university levels. However, the way in which these factors may influence future teachers has not been explored in depth. Therefore, the present work stated three aims. First, to characterise the pre-service teachers (first-year university students in infant and primary education) in terms of the level of computational thinking based on four dimensions of study (simple, looping, conditional, and advanced conditional algorithms). The second aim was to analyse whether there are statistically significant differences between the level of computational thinking according to gender and the previous experience in robotic programming languages that pre-service teachers have. And the third aim was to identify the existence of profiles that allows us to analyse the differences between them with the dimensions of computational thinking in order to obtain a more solid understanding of how these factors may influence students’ computational thinking.
2. Materials and Methods
2.1. Participants
A total of 164 infant and primary education pre-service teachers participated in the study; 145 of them were female (88.4%) and 19 were male. All of them were university students enrolled in the first year of infant and primary education degrees, which comprises a total of four years. The age of the participants was mostly (72.3%) between 18 and 21, followed by those aged between 22 and 25 (23.1%), and those between 26 and 29 years, with 4.6%. The choice of the sample followed a non-probabilistic paradigm, following criteria of convenience and accessibility [
31].
2.2. Analysis Instrument
Research on the assessment of computational thinking agrees that there is no specific and accepted method [
32]. Computational thinking is a skill that is related to others such as logic, creativity, or problem solving, and, consequently, its assessment could be performed in several different ways. Thus, the instrument Fairy Assessment in Alice has relied on both assessing objects programmed by students and analysing their responses to predesigned programming questions to try to measure abstraction, conditional logic, and algorithmic thinking [
33]. Also, the Computational Thinking Framework (CTF) is a framework for assessing both computational thinking learning materials and resources as well as student skills [
34]. Both instruments focus on the secondary and high school stages. To address advanced vocational education, Lee et al. [
35] designed a test consisting of a selection of 15 task problems extracted from the International Bebras Contest.
On the other hand, the Computational Thinking Test (CTT) is aimed to measure the computational thinking of the subjects [
36]. It consists of twenty-eight questions with four response choices, only one of which is correct. The instrument does not require any previous programming experience. The questions show different scenarios in which logical-mathematical thinking skills must be applied in order to solve them correctly. The CTT has been translated into several languages and used by the international scientific community in multiple investigations [
37,
38].
Despite the available instruments, there is a notable absence of tests designed specifically for the university education stage that have undergone a complete validation process. Consequently, given the lack of standardized instruments for measuring computational thinking at the university level, the CTT, validated by Román-González [
36], was used in terms of its content, reliability and criterion, and concurrent validity. The CIT has been used at the university level in several studies and has been extensively validated in the Spanish context, with high levels of concurrent validity [
39,
40,
41]. The
Computer Science Teachers Association (CSTA) proposes computational thinking among the curricular standards and considers three development levels [
42]. At the third level, it equates high school and first year of university. Thus, the CSTA considers that high school and first year of university have the same level of curricular development in terms of computational thinking. Therefore, the use of the CTT instrument for the present study can be considered appropriate.
Although the instrument had been validated, an analysis of its psychometric properties was performed. Thus, the corrected item–total correlation (ri-t) was positive for all items, indicating that they all contributed to measuring the general construct measured by the instrument and in the same direction. Cronbach’s Alpha was adequate (0.705) with a mean item score of 0.76. The Kaiser–Meyer–Olkin measure of sampling adequacy was 0.599, and Barlett’s test of sphericity was significant (p < 0.001), with a chi-square value of 0.599 and 231 degrees of freedom.
To achieve the stated objectives, three additional data were collected. Firstly, we determined the level of prior programming knowledge that students considered they had, using a Likert-type scale from 1 to 5 (where 1 equals Very Low and 5 equals Very High). Secondly, students were asked whether they had previous experience in robotics programming through a dichotomous question (Yes or No), in which they were asked if at any time they had used programming tools such as Scratch, Arduino, Lego, Alice, etc. Finally, the performance level of the university students was used as a reference measure. This level of performance was based on the grade obtained by the students in the subject of Information and Communication Technologies (ICT) applied to the education of the infant and primary education pre-service teachers, since several authors consider the grades obtained as a valid indicator to measure academic performance [
43,
44], in this case, in the field of technologies. The ICT subject evaluates both theoretical and practical knowledge through four types of activities: (1) exploration and analysis activities, aimed at promoting reflection on ICT through group dynamics; (2) evaluation and diagnosis activities, especially of digital and audiovisual materials; (3) design activities of digital and multimedia materials (short animation films, creation of digital games, etc.); and (4) activities of the didactic integration of ICT. With these activities, students put into practice problem-solving skills, planning, organization, creative and deductive abilities, etc. The final grade of the course is based on the achievement in the written test, in which theoretical and practical knowledge are evaluated, as well as on the results of the laboratory practices.
2.3. Procedure
The study was conducted in accordance with the World Medical Association Code of Ethics (Declaration of Helsinki), which reflects the ethical principles for research involving human subjects [
45]. Prior to conducting the CTT, students were informed that their participation was voluntary. Participants were required to give informed consent prior to completing the questionnaire.
The students completed the CTT digitally, accessing it through the link sent to their corporate emails at the university before carrying out the training actions on robotics programming within the framework of the aforementioned subject. Therefore, an exploratory study was carried out in order to determine the initial state of the incoming students to the degrees in Infant Education and Primary Education in order to generate training actions that support their academic performance in the field of STEM competences.
Once the answers had been collected, those that were answered incorrectly were assigned a value of 0, and those that were correct were assigned a value of 1. Subsequently, the items were grouped according to the type of skills required for their correct resolution, giving rise to four dimensions, as follows: (1) simple algorithms (SA), made up of seven linear programming scenarios; (2) loop algorithms (LA), made up of seven practical scenarios where the programming sequence is repeated several times; (3) conditional algorithms (CA), made up of seven scenarios based on stipulating certain basic conditions for the programming blocks to be executed; and (4) advanced conditional algorithms (ACA), made up of seven scenarios and, like the previous one, focus on establishing advanced conditions for solving the problems posed. Finally, the scores in each of the four dimensions were weighted, obtaining scores from 0 to 10 in each of them.
2.4. Data Analysis
Firstly, to analyse the existence of differences in the four dimensions that make up computational thinking according to gender and students’ previous experience in programming languages, t-tests for independent samples were carried out.
A two-stage cluster analysis was used to obtain the student profiles. This analysis provided an automatic procedure of the optimal number of clusters, allowing clusters with categorical and continuous variables [
46]. The variables included in the cluster were “gender”, “previous experience in robotic programming languages”, “level of knowledge that students consider possessing about programming”, and “level of performance”, measured from 0 to 10 and calculated from the final grade obtained in the subject. The model complies with the assumptions of independence between its variables, the continuous variables follow a normal distribution, and the categorical qualitative variables follow a multinomial distribution. Even if these assumptions were not met, Rubio and Vilá [
46] indicate that this procedure is robust enough to be applied. To analyse the distance between clusters, the log-likelihood measure was used. The Bayesian Schwartz Criterion (BIC) was used to determine the number of clusters. To minimise order effects, the cases were randomly ordered. The results yielded a satisfactory model consisting of three clusters.
Finally, once the students’ profiles were obtained, a one-factor ANOVA with post hoc tests was used to analyse each of the four dimensions of computational thinking (simple algorithms, loop algorithms, conditional algorithms, and advanced conditional algorithms) in terms of these profiles.
The data obtained were analysed using SPSS 27, with a
p-value < 0.05 as a reference for significance. Effect sizes were assessed using partial eta squared, considering that the effect size is small when η
p2 = 0.01, medium when η
p2 = 0.059, and large when η
p2 = 0.080 [
47].
3. Results
Table 1 presents the descriptive statistics of the variables as well as the Pearson correlation matrix. The values of skewness and kurtosis lie within the limits indicating a normal distribution (values of less than 3 for skewness and less than 10 for kurtosis), [
48].
Regarding the scores, the highest means are found for simple and loop algorithms, with questions on applying mathematical-logical knowledge of conditionals and advanced conditionals obtaining the lowest scores. Regarding correlations, the results showed statistically significant and positive correlations between the variables under study in all cases.
On the other hand, as shown in
Table 2, only 21.3% of the study sample has previous experience in programming languages, considering that more than half of them have a low level in this type of knowledge. However, the average level of academic performance in the subject and the level of computational thinking skills derived from the CTT are of around 7.
To determine the differences in the dimensions that make up computational thinking based on gender and students’ previous experience in programming languages, t-tests were performed for independent samples. The results showed that the differences were statistically significant between the scores obtained in the simple algorithms dimension and that of gender (t162 = −1.87, p < 0.001, np2 = 1.16), with a large effect size. The results indicated that males (M = 9.73; SD = 0.624) scored higher than females (M = 9.20; SD = 1.21).
Similarly, statistically significant results are obtained between the scores obtained in the simple algorithm dimension (t162 = 2.30, p < 0.001, and np2 = 1.15) according to the students’ previous experience in programming languages, with a large effect size. The results indicated that students with prior experience (M = 9.66; SD = 0.97) scored higher than those without (M = 9.16; SD = 1.19).
Significant results were also obtained in the loop algorithm dimension (t162 = 2.34, p = 0.04, and np2 = 1.62) according to students’ prior experience in programming languages, with a large effect size. The results indicated that students with prior experience (M = 8.61; SD = 1.24) scored higher than those without (M = 7.89; SD = 1.71).
In terms of obtaining student profiles from a cluster, three groupings were obtained with the four variables with a “good” result, indicating, in line with Kaufman and Rousseeuw [
49], that the data reflect reasonable and strong evidence of a cluster structure. The variable that carries the most weight is the level that students believe to possess in programming (with a predictor significance of 1 out of 1), followed by previous experience in programming languages (with a significance of 0.59 out of 1), gender (with a significance of 0.29 out of 1), and lastly, level of performance in the subject (with a significance of 0.01 out of 1). The characteristics of the three clusters are as follows:
Cluster 1: A cluster made up of 31.7% of the sample, where 48.1% declare that they have a low level of knowledge of programming languages, 67.3% declare that they have previous experience in programming languages, 63.5% are women, and their average level of performance in the subject is 7.06. We will call this cluster “initiates in robotics programming” (IRP), and it is made up of those students who have had experience and have used programming at some point.
Cluster 2: A cluster made up of 32.3% of the sample. All of them (100%) declare that they have a very low level of knowledge of programming languages, they have no previous experience in programming languages, they are all women, and their average level of performance in the subject is 7.13. We will call this cluster “novices in robotics programming” (NRP), made up of those students who have had very little contact with programming.
Cluster 3: A group formed by 36% of the sample with the following characteristics: all (100%) have a low level of knowledge about programming languages, have no previous experience in programming languages, all are female, and their average level of performance in the subject is 6.98. We will call this cluster “explorers in robotic programming” (ERP), and it is composed of those students who have started to investigate programming languages.
To analyse the differences between the profiles obtained with the students’ knowledge in the dimensions that make up computational thinking, a one-factor ANOVA analysis was carried out using Welch’s procedure. There, statistically significant differences were found in “Simple algorithms” according to the cluster type (F w 3, 726 = 3.92, p < 0.022), with a mean effect size (np2 = 0.46). This was also the case in “Loop algorithms” (F w 3, 952 = 4.34, p < 0.015), with a medium effect size (np2 = 0.51).
Similarly, the overall level of computational thinking possessed by university students was analysed. Significant differences were obtained according to the type of cluster (F w 3, 699 = 3.65, p < 0.028), with a medium effect size (np2 = 0.43).
Subsequently, the Bonferroni procedure was used to analyse the post hoc multiple comparisons, the results of which are shown in
Table 3:
The post hoc analysis regarding the results obtained by the university students in those questions that measure knowledge related to loop algorithms are shown in
Table 4:
Similarly, the post hoc analysis regarding the results obtained by the university students in the Computational Thinking Test according to the profiles defined in the cluster analysis are shown in
Table 5:
In all cases, the cluster “Initiates in robotic programming” (IRP), formed by those students who have had experience and have used programming at some point, obtained better scores than the profile of students called “Explorers in robotic programming” (ERP), formed by those students who have started to investigate programming languages and who state that they have some level of knowledge in programming languages. It is noteworthy that those who have no previous experience in programming languages perform less well in the CTT. This result confirms the need to address this type of knowledge in the training of future teachers to strengthen STEM competences.
4. Discussion and Conclusions
Computational thinking is characterised by a specific way of thinking that favours the analysis and relation of ideas for the organisation and logical representation of information. In recent years, there has been a growing need to develop it in education in order to respond to the needs of an increasingly technological society. We are thus dealing with the emergence of a new literacy that seeks to encourage the learning of programming in a progressive way by using basic principles of computer coding through the use of algorithms. Therefore, the general objective of this study is to analyse the level of computational thinking of university students in order to determine the initial state of incoming students to infant and primary education pre-service teachers. Specifically, three specific aims were defined: (1) characterise the participants in the sample in terms of the level of computational thinking; (2) to study the existence of differences in the level of computational thinking according to gender and previous experience of university students in robotic programming; and (3) to identify the existence of profiles that allow us to analyse the differences between these profiles with the dimensions of computational thinking. Regarding the first objective, pre-service teachers obtain higher scores in simple and loop algorithms, being the questions related to applying mathematical-logical knowledge about conditionals and advanced conditionals the ones that obtain lower scores. Therefore, and according to the results obtained, the study sample has a low/medium level of computational thinking with basic algorithmic notions presenting weaknesses in conditional logic. In this way, it is possible to identify which skill each student needs to reinforce learning. The data collected allow us to define the infant and primary education pre-service teachers in terms of their level of computational thinking, establishing which skills require a greater focus from a first diagnosis in order to subsequently promote training proposals adapted to the needs of each student.
In relation to the second objective, it was possible to confirm the existence of differences according to gender, in line with previous studies collected in the review conducted by Kiliç [
50]. In the present study, men obtaining better scores in the simple algorithms dimension. These results are in line with those obtained by other studies [
15,
51], among others, that found that men showed greater conceptual understanding, using more advanced strategies and algorithms than women in robotic programming processes. And some studies have even found that, despite having a high level of thinking, women lack interest in programming [
52], indicating that they may lack the necessary motivation. It is therefore essential to pay attention to these differences when carrying out teaching–learning processes, since knowing the interests of students can develop activities that increase their motivation and have an impact on improving academic results. In this sense, as Kanny et al. [
53] point out, by promoting gender equality, challenging stereotypes, and providing equal opportunities, we can encourage the participation of women, harnessing the talent and creativity of all individuals, regardless of their gender.
Similarly, differences were found according to students’ prior experience with robotic programming languages, with those who had prior experience performing better on the simple and loop algorithms dimensions. Sun et al. [
26] found that those students who had learned to program at an early age had a higher level of computational thinking. Therefore, there is a strong need for appropriate teaching strategies at different stages of learning. Moreover, computational thinking and programming are closely linked, and teaching them together can provide students with powerful tools to understand and address the challenges of the digital age.
Along the same lines, the third objective sought to identify the existence of profiles and to analyse the differences between them in terms of the dimensions of computational thinking. The results of the study reflect the existence of three student profiles. In a cluster called IRP, where 48.1% of the students declared to have a low level of knowledge of programming languages, 67.3% had previous experience in programming languages, 63.5% were women, and their average level of performance in the subject was 7.06. This cluster has the highest levels of computational thinking. The second cluster called NRP is characterised by the fact that all students report a very low level of knowledge of programming languages and have no previous experience in programming languages; they are female, and their average level of performance in the subject is 7.13. This cluster has an average level of computational thinking. And, finally, the so-called ERP, characterised by those students who have a low level of knowledge of programming languages, have no previous experience in programming languages, are female, and their average level of performance in the subject is 6.98. This group has the lowest level of computational thinking.
These results highlight the complexity of the interaction between the variables analysed. However, we found a group of students, mostly women with previous experience in programming languages, who obtained high levels of computational thinking, especially in the dimensions of simple algorithms and loops. This result supports the idea proposed by Kelleher and Pausch [
54] that scaffolding-based instructional design is at the heart of programming instruction in training planning. In this line, the design of training actions that take into account students’ starting profiles may be the key to developing computational thinking, cultivating talent among trainee teachers, and enhancing STEM skills. Thus, in order to develop computational thinking, it is necessary to know and understand the mechanisms involved in its implementation in a simple and structured way, understanding how problems are solved through logical systems. The results obtained show the need to offer educational proposals that contribute to strengthen the teaching-learning processes through didactic resources and materials that provide dynamism, flexibility, and innovation. Thus, it is proposed to adapt to the training program of future teachers, the TangibleK programme [
55], which uses robotic programming through algorithms as a tool to stimulate computational thinking among university students.
In this context, we propose to adapt and integrate in the training of future teachers the basic principles defined by Bers [
55]: (1) making visible the design process and the computational thinking required to program the robot—in other words, posing a problem, researching, planning, developing a prototype, testing, redesigning, and analysing the solutions; (2) enhancing collaboration by creating teams that share resources and materials; (3) generating technology conversation groups to share the robotic programming projects developed by the different groups of students, which provides the opportunity to correct mistakes as a community; and (4) transferring the projects beyond the classroom to make the learning visible, testing it through demonstrations, exhibitions, etc., or applying it in classrooms, by making it visible in the classroom, or by applying it in infant and/or primary classrooms as future teachers. In this way, through a simple sequencing, focusing on identifying the starting knowledge, introducing the project through games, proposing a programming task, sharing it through the technology conversation groups, and evaluating the task, future teachers are provided with the tools and skills necessary to foster computational thinking in the classroom.
Undoubtedly, studies on computational thinking are developing and deserve more research, especially among trainee teachers, as they are the basis for enhancing computational thinking in infant and primary school classrooms. Although this research has provided some important results on the levels of computational thinking among university students and the variables that may condition these levels, some limitations must be taken into account. Firstly, the size of the sample and having opted for a cross-sectional design. Future research can dynamically track the evolution of students’ computational thinking by using longitudinal data and expanding the study sample to make more robust causal inferences. Secondly, the nature of the sample belongs to two very specific contexts. In order to verify better results, the study is to be directed towards students from other education-related degrees. Finally, this study has mainly used quantitative data for analysis, and future research may add qualitative data such as interviews to complement the research results.