Introduction

Programming education has become increasingly important in the current higher education system because it could promote college students’ computational thinking skills, which are vital in various working situations (Jancheski, 2017; Stehle & Peters-Burton, 2019). However, the endeavor to harness the advantages of programming is not devoid of obstacles. Extensive research has determined that students actively engaged in programming education may encounter a range of challenges (Looi et al., 2018; Sun et al., 2021a). The challenges that were faced included a deficiency in pertinent technical skills and obstacles hindering the ability to access crucial resources (Bau et al., 2017; Tom, 2015). The challenges that college students face in their programming learning can have a negative impact on their overall educational experience. In this regard, it seems necessary to offer comprehensive support to college students in their programming learning process (Lu et al., 2017; Sun et al., 2021d).

The use of certain technological enablers, for instance, interactive coding platforms, integrated development environments (IDEs), and online coding communities, has a substantial impact on the level of programming performance and behavior. They may lead to promoting the acquisition of programming skills, facilitating their practical application, and catering to the personalized preferences of programming learners (Chevalier et al., 2020; Ghatrifi et al., 2023; Nurbekova et al., 2020). An exemplary illustration of programming education can be found in the utilization of ChatGPT. The impact of ChatGPT on learning has been remarkable, as it has brought about a revolutionary wave of technological advancements that have greatly facilitated the teaching and learning processes (Firaina & Sulisworo, 2023; Lo, 2023). ChatGPT may be a resource for determining performance, learning, and discussing numerous programming-related topics. ChatGPT can formulate, clarify, and illustrate code samples in response to students’ inquiries. It has the potential to serve as an exhibition platform for various programming solutions, explanations of various methodologies, and illustrative approaches (Chen et al., 2023; Yilmaz & Yilmaz, 2023a). ChatGPT can generate a customized learning trajectory based on the learner's existing proficiency and desired objectives in programming learning. ChatGPT can provide recommendations for online courses, tutorials, books, and many other resources to enable ongoing personal and professional development (Jalil et al., 2023; Surameery & Shakor, 2023; Tian et al., 2023). ChatGPT exhibits exceptional characteristics, including the capability to produce text that faithfully replicates authentic human dialogue when given inputs. This feature is very different from traditional teacher-led instruction, and it makes people think about how it could be used and incorporated into programming education (Firaina & Sulisworo, 2023; Javaid et al., 2023). Further significant factors exist that necessitate scrutiny. Notably, conventional teaching methods do not significantly impact the accessibility of vital information; rather, it is ChatGPT's sophisticated algorithmic architecture and computational prowess that ensure its availability. In addition, it's important to acknowledge that there may be some inaccuracies in the error detection system of ChatGPT, which could potentially impact students' motivation and capacity to utilize the feedback provided.

What learning mode is more effective and preferred by college students for programming learning remains uncertain. This uncertainty is partly attributed to programming learning studies to date have been based on the comparison between the most commonly used technological sources and devices and traditional learning forms. As an illustrative instance, researchers have juxtaposed and contrasted various programming methodologies. Sun et al. (2021a), for instance, attempted to harmonize text-based programming techniques with isomorphic block-based techniques. With instructor-led delivery, Sun et al. (2021b) sought to reconcile learner-oriented, unplugged programming. Sun et al. (2021d) facilitated the lectures on novice programming instruments and the transition from Logo to Scratch. To address these obstacles, teachers have implemented innovative pedagogical approaches, including game-based learning, offline instruction, and project-centric programming, which are commonly used in informal learning environments. The primary aim of these methodologies is to convert traditional instructor-led programming instruction into interactive, learner-focused programming activities (Brackmann et al., 2017; Hosseini et al., 2019; Nurbekova et al., 2020).

For this study, we utilized Davis’ (1989) technology acceptance model (TAM) as a theoretical framework to investigate students' acceptance of ChatGPT in programming education. Researchers have used Davis’ (1989) technology acceptance model as a framework to look into how students interact with AI-based learning technologies (**e et al., 2023) by looking at the currently published academic literature. Researchers extensively employ the TAM framework in studies focused on the domain of programming learning. Studies conducted by Cheng (2019) and Thongkoo et al. (2020) have provided evidence that supports the claim that the TAM is a valid predictive model for technological adoption in programming learning. In today’s modern era, the widespread use of computing technology has made it an essential tool for students. It has become so prevalent that it is now considered indispensable, enabling students to take charge of their learning and strive toward long-term objectives such as skill enhancement (Peng et al., 2023). Developed by Davis (1989), TAM aims to shed light on the factors that influence user behavior in adopting new technologies (**e et al., 2023). According to the TAM, users’ perceptions of a technology's usefulness and ease of use play a vital role in determining their adoption and regular usage of it (Davis, 1989). In addition, the attitudes and behavioral intentions of users play a crucial role in determining their willingness to adopt technology in the learning process (Yang & Tsai, 2008; Yi et al., 2016). Perceived ease of use is a concept that revolves around how users assess the simplicity or complexity of a technological device or system based on their impressions and expectations (Davis, 1989). When considering the value of a particular technology, it is important to take into account an individual's assessment of how it will enhance their work efficiency (**e et al., 2023). When a new piece of technology is perceived as user-friendly, the chances of people embracing it are significantly higher. Nevertheless, individuals tend to become less inclined to utilize technology when they encounter challenges in acquiring the necessary skills to operate it (Teo et al., 2008).

It will be worth exploring the effectiveness of ChatGPT in programming learning. In this regard, this study aimed to explore the impact of ChatGPT-facilitated programming on college students’ programming behaviors, performance, and perception by comparing two kinds of learning modes: ChatGPT-facilitated programming (CFP) mode and traditional self-directed programming (SDP) mode. There were four research questions:

  • RQ1: What are the differences in the programming behaviors of students engaged in CFP mode compared with those in SDP mode?

  • RQ2: What are the differences in the programming performances of students engaged in CFP compared with those in SDP mode?

  • RQ3: How do college students describe their user experiences with ChatGPT in CFP mode?

  • RQ4: How do college students' perceptions of ChatGPT change following their experience with CFP mode?

The results of this study offer significant insights that can inform policy-making regarding the most effective approaches to expand and support programming education at the college and university levels. Despite being conducted within the specific context of China, our research findings and consequences hold significance for scholars, policymakers, and practitioners worldwide. Countries, regardless of their level of development, can recognize and rectify possible deficiencies in programming education through careful consideration of the data presented in our research. The advent of AI tools such as ChatGPT introduces novel complexities to programming instruction. Our research makes a significant and innovative contribution to this urgent matter at an international level. The ramifications transcend academic settings and universities, encompassing the approaches and policies of governments across the globe. In conclusion, the findings of this inquiry substantially advance our comprehension of the perspectives held by aspiring teachers worldwide regarding the application of ChatGPT in computer programming instruction.

Literature review

Advancing programming education with AI-technologies

Technology-enhanced programming learning has been gaining momentum in recent years with the advance of AI technologies. This literature review examines the new trends in the programming and learning fields that have emerged in the age of AI. One of the significant trends in programming education is the integration of AI-powered tools such as chatbots, intelligent tutoring systems, and automated programming assessment software. These tools offer students personalized instruction and immediate feedback to help them progress at their own pace and improve their programming skills. For example, Skalka et al. (2021) proposed a conceptual framework that combines micro-learning and automatic evaluation of source code to give students immediate feedback and involve them in software development in a virtual learning environment. This framework was shown to significantly improve the results of students in advanced programming courses. In the Programming 1 course, Malik et al. (2022) introduced a chatbot that was specifically engineered to highlight problem-solving strategies, common programming errors, syntax, and semantics, with the ultimate goal of assisting inexperienced learners in simultaneously mastering a variety of competencies. The students perceived the chatbot's methodology as advantageous in the above-mentioned points. Klasnja-Milievi et al. (2016) also designed an Intelligent Tutoring System called Programming-Tutor that uses AI to provide an immersive learning experience for online programming courses in the Pacific. This ITS is expected to help students learn programming more easily and efficiently in an online mode and provide valuable formative assessment while enhancing student learning.

Furthermore, the application of data analytics, machine learning, and natural language processing technologies in programming education has gained popularity. These innovations can help analyze programming-related data, extract valuable insights into learners' programming skills, and pinpoint areas where improvement is needed to enable effective feedback and instruction. For instance, Khan et al. (2019) developed a model to predict the performance of introductory programming students based on their early semester grades. The researchers used WEKA to compare eleven different machine-learning approaches and found that the Decision Tree algorithm did the best in terms of recognizing instances, being accurate on the F-measure, and finding true positives. This model is expected to enable students to forecast their probable final grades, empowering them to modify their study approaches for better academic results. In a similar vein, Sivasakthi et al. (2017) developed a predictive data mining model that utilized classification algorithms to predict the performance of first-year Computer Application bachelor's degree students in introductory programming. The research ascertained the most efficient classification algorithm and demonstrated the accuracy of each algorithm in use. In addition, Shen et al. (2023) proposed a student profile model that includes code information and other student characteristics as input to a deep neural network for performance prediction and found that a four-layer deep neural network using all available dimensions of student profiles achieved the best performance.

Despite these promising trends, challenges remain in effectively integrating AI technologies into the learning process. These challenges include ethical considerations such as privacy, security, and bias, and tensions between the use of AI-powered tools and the human aspect of programming involving creativity and problem-solving skills (Gervasi et al., 2021; Mousavinasab et al., 2021; Wang et al., 2023). Recent advancements in large-scale language modeling and AI, such as interactive text generators capable of responding to user prompts (Yilmaz & Yilmaz, 2023c), have not been adequately explored or recognized in programming education. This leaves a gap in implementing state-of-the-art technologies in programming education pedagogy.

Integrating ChatGPT in the programming filed

Its unique features distinguish ChatGPT from conventional programming utilities. Surameery and Shakor (2023) and Yilmaz and Yilmaz (2023c) emphasize that ChatGPT, as an AI language model, enhances its usability for individuals without prior programming knowledge by engaging in conversational language with users. Ray et al. (2014) commonly portray conventional programming resources, such as programming environments, programming languages, libraries, and associated components, as requiring programming expertise and often focusing on a single language. A Python integrated development environment purposefully developed for Python requires users to possess a foundational understanding of this programming language. In contrast, multi-platform integrated development environments such as Flutter or Microsoft Visual Studio support multiple programming languages. In light of this, ChatGPT employs machine learning and natural language processing technologies to accurately interpret and respond to user inputs expressed in colloquial language. In contrast to conventional programming languages, which adhere to particular syntax and principles, ChatGPT is designed to comprehend user inquiries and provide appropriate responses, as explained by OpenAI (2023). According to Jalil et al. (2023), ChatGPT presents a novel programming pedagogical approach that is suitable for a diverse range of individuals, including teachers and students.

However, there are conflicting views on the effectiveness of ChatGPT in programming education. On one hand, Yilmaz and Yilmaz (2023b) highlight the various advantages that ChatGPT offers over other programming tools, such as utilizing natural language, providing easy access, offering quick response times, facilitating personalized learning, supporting multiple languages, offering clear explanations and programming examples, allowing for inquiries and searches, and providing resources for advanced topics. According to Yilmaz and Yilmaz (2023a), ChatGPT distinguishes itself from other programming tools through its utilization of colloquial language, user-friendly interfaces, support for multiple languages, comprehensive search capabilities, provision of lucid explanations accompanied by practical illustrations, facilitation of personalized learning experiences, and engagement with complex subject matters. Yilmaz and Yilmaz (2023c) conducted a study that found that the utilization of generative AI tools, including ChatGPT, could potentially enhance students' morale, programming confidence, and aptitude for computational reasoning. Additionally, Chen et al. (

Fig. 1
figure 1

ChatGPT-facilitated programming platform used in CFP mode

Data collection and analysis approaches

Four methods were used to collect and analyze the data for this study. We documented the programming behaviors of the students by monitoring platform logs and recording computer screen videos (excluding audio). For research facilitation, we selected video recordings of the data obtained during the final class session (specifically, the radar chart task), which averaged 40 min per learner, resulting in a total of 3280 min. We selected the final session for data collection for two primary reasons: first, it focused on a comprehensive programming task that provided a holistic view of how ChatGPT integrated into resolving programming challenges and demonstrating programming performance; and second, informal observation revealed that students in the experimental group had developed performance in utilizing ChatGPT and were more actively involved in this session. By utilizing clickstream analysis (Filva et al., 2019) on this data, we were able to discern the programming behaviors of the students. We conducted the video analysis using a recurrent coding procedure that adhered to a previously approved coding framework (Sun et al., 2021a, b, c, d). Following an initial individual evaluation of the screen-captured videos by two coders who were well-versed in video analysis, they identified preliminary codes representing programming behaviors. Subsequently, the coders collaboratively discussed these codes to arrive at a final coding arrangement, as detailed in Table 1. Based on this coding framework, each coder autonomously recorded the data in chronological order, annotating learner behaviors every 10 s and validating the results with one another. Additionally, we employed lag-sequential analysis (LsA) to assess the behavioral patterns of the learners, using the video coding outcomes as a foundation (Faraone & Dorfman, 1987). Evaluating the frequency of transitions between two behaviors and network representations displayed in two instructional modes was entailed. We chose Yule's Q to represent the extent of transitional associations because it has descriptive value and can account for base numbers of contributions (ranging from − 1 to + 1, with zero indicating no association). This study used a network visualization technique previously developed (Chen et al., 2017) to illustrate the outcomes of LsA in networks. Nodes represent behavior codes along with their corresponding frequencies, while edges denote transitional Yule's Q values. An arrow pointing in the opposite direction of the node denotes the direction of the transition.

Table 1 Coding framework for programming behaviors

Secondly, we evaluated the students' programming performance by assessing their programming assignments. The programming task involved develo** a radar chart, with an advanced requirement being the creation of a Holland radar chart and a simplified radar chart serving as the primary requirements. The first author assessed the scores on a scale of one hundred using a rubric that included aspects such as code correctness, programming project aesthetics, and functional integrity. A T-test was employed to compare the academic performance of students enrolled in the two courses.

Thirdly, we conducted semi-structured post-class interviews with students, specifically focusing on their experiences using ChatGPT to practice programming (the interview instrument can be found in Appendix A). We followed a rigorous procedure of thematic analysis to examine the interview data (Cohen et al., 2013). The methodology consisted of the subsequent steps: (1) getting interview transcripts ready for analysis; (2) having two separate coders assign codes to different parts of the data; (3) recording the coded segments so that they can be analyzed later; (4) talking about and comparing parts of the data that have the same codes; (5) aligning and improving the codes to make themes that make sense; and (6) checking the validity and reliability of the themes that were made. Transcripts containing statements such as “I appreciated the human-like explanations ChatGPT provided whenever I made a syntax error; it facilitated my learning pace” and coded segments including “ChatGPT provided human-like explanations; it facilitated my learning pace; identify and correct code errors” serve as an example of this procedure in our research. The codes were subsequently integrated and refined into the theme “experience with ChatGPT”. To offer additional elucidation, the themes refer to the discernible patterns or concepts that permeate the data and are substantial in delineating a phenomenon while also being relevant to the research inquiry. A theme related to "experience with ChatGPT" may manifest in our research, as student responses inquire about the pros and cons of ChatGPT. Moreover, codes serve as the identifiers assigned to specific data points to concisely represent or summarize the data. For example, situations in which students refer to "extensive programming knowledge" and "various and contextualized responses" could be interpreted as "ChatGPT experience." Moreover, we refer to the data segments that have been assigned unique identifiers as "coded segments." In our research, a coded segment may consist of a participant reminiscing about personal experiences while extracting a sentence or paragraph from the interview transcript.

Fourthly, at the beginning and end of the sessions, we distributed questionnaires to determine the students' perceptions of ChatGPT in the CFP mode. We employed a modified version of the survey instrument created by Venkatesh and Davis (2000) as well as Sánchez and Hueros (2010) for this investigation. Two distinct sections comprised the survey. The primary objective of the initial segment was to gather data from participants concerning their demographic attributes, prior encounters, and anticipations concerning ChatGPT. The following segment comprised questions rated on a seven-point Likert scale, where a rating of one indicated strong disagreement and a rating of seven indicated strong agreement. The investigations revolved around four core domains: perceived usefulness, perceived ease of use, intention to use, and attitude. For additional information, please consult Appendix B. An independent T-test and descriptive analysis were used to ascertain the outcomes based on the gathered data.