1. Introduction
Artificial Intelligence (AI) has rapidly transformed higher education, particularly in programming education, where AI-powered tools such as code assistants, chatbots, and automated debugging systems are increasingly integrated into learning environments. These technologies have shifted traditional programming pedagogy from memorization-based learning to AI-augmented problem solving, enabling students to generate, evaluate, and refine code more efficiently. However, this transformation has also raised critical concerns regarding the nature of AI usage, particularly distinguishing between productive AI usage, which enhances learning and understanding, and unproductive AI usage, which may lead to over-reliance, cognitive offloading, and superficial learning (Kasneci et al., 2023; Dwivedi et al., 2023).
In programming education, productive AI usage refers to the strategic use of AI tools to support conceptual understanding, debugging, algorithmic thinking, and creative problem-solving. In contrast, unproductive AI usage involves passive acceptance of AI-generated solutions without critical evaluation or comprehension, which may weaken students’ computational thinking skills and independent problem-solving abilities (Zawacki-Richter et al., 2019). The increasing accessibility of generative AI systems such as ChatGPT and GitHub Copilot has intensified this duality, making it essential to examine how different usage patterns influence learning outcomes.
Learning behaviour in programming education is strongly influenced by cognitive engagement, metacognition, and self-regulated learning strategies. Prior research highlights that meaningful engagement with learning technologies enhances deep learning and skill acquisition, while surface-level engagement reduces long-term retention and conceptual mastery (Zimmerman, 2002; Chen et al., 2020). In this context, AI tools can either support or hinder learning depending on how students interact with them.
Furthermore, creativity in programming defined as the ability to generate innovative, efficient, and alternative coding solutions is increasingly recognized as a critical competency in the digital economy. AI systems can stimulate creativity by providing multiple solution pathways; however, excessive reliance on AI may suppress divergent thinking and reduce originality in problem-solving (Amabile, 1996; Boden, 2004). Therefore, understanding the impact of AI usage patterns on creative programming behaviour is essential.
Programming performance, often measured through academic achievement and coding proficiency, is influenced by both cognitive and behavioural factors. While AI tools may enhance performance by improving efficiency and reducing errors, uncritical usage may lead to inflated performance outcomes that do not reflect true skill acquisition (Luckin et al., 2016). This raises important questions about the sustainability of AI-enhanced learning outcomes.
To address these challenges, individual differences such as AI literacy and mindfulness are increasingly recognized as critical moderating factors. AI literacy refers to the ability to understand, evaluate, and effectively use AI systems in learning contexts. Students with higher AI literacy are more likely to use AI tools critically and strategically, thereby maximizing learning benefits (Long & Magerko, 2020). Mindfulness, defined as present-moment awareness and attention control, plays a key role in reducing cognitive overload and improving self-regulated learning behaviour, particularly in digital learning environments (Brown & Ryan, 2003).
Despite growing interest in AI in education, limited empirical research has examined the combined effects of productive and unproductive AI usage on learning behaviour, creativity, and programming performance, particularly in developing country contexts such as Sri Lanka. Moreover, the moderating roles of AI literacy and mindfulness remain underexplored in programming education research.
Therefore, this study aims to fill this gap by investigating how productive and unproductive AI usage influences learning behaviour, creative programming behaviour, and programming performance, while also examining the moderating effects of AI literacy and mindfulness among undergraduate programming students in Sri Lanka.
1.2 Research objectives
1.2.1 Main objective
The primary objective of this study is to examine how productive and unproductive artificial intelligence (AI) usage patterns influence learning behaviours, creative programming behaviour, and academic performance among programming students, while assessing the moderating roles of AI literacy and mindfulness. The increasing integration of AI tools such as generative coding assistants in education necessitates a deeper understanding of both their benefits and potential drawbacks (Dwivedi et al., 2023; Kasneci et al., 2023).
1.2.2 Specific objectives
This study aims to:
1. Identify the prevalence, frequency, and purposes of AI tool usage among programming students in Sri Lanka, given the rapid diffusion of AI technologies in educational environments (Zawacki-Richter et al., 2019).
2. Examine the relationship between AI usage patterns and students’ learning behaviors in programming contexts, particularly how AI influences self-directed learning processes (Zimmerman, 2002).
3. Differentiate between productive and unproductive AI usage patterns and evaluate their effects on:
○ learning strategies
○ creative programming behaviour
Prior research highlights that while AI can enhance learning, over-reliance may hinder cognitive engagement (Kasneci et al., 2023).
4. Analyze the relationship between learning strategies and creative programming behavior, as deeper learning approaches are associated with higher creativity and problem-solving ability (Biggs & Tang, 2011).
5. Assess the impact of creative programming behavior on academic performance, including assignments and examination outcomes, consistent with research linking creativity and performance in computing education (Amabile, 1996).
6. Examine the role of mindfulness in enhancing creative programming behaviour, as mindfulness has been shown to improve attention, cognitive flexibility, and creativity (Brown & Ryan, 2003).
7. Investigate the moderating effect of AI literacy on the relationship between AI usage patterns and learning behaviours, as digital and AI literacy influence effective technology use (Ng, 2012).
8. Evaluate whether unproductive AI usage negatively affects learning effectiveness and creative engagement in programming activities.
2. Literature review
2.1 Artificial intelligence in programming education
Artificial Intelligence (AI) has increasingly become an integral component of programming education, reshaping how students learn coding, debug programs, and develop computational thinking skills. AI-powered tools such as intelligent tutoring systems, automated code generators, and generative AI platforms (e.g., ChatGPT and GitHub Copilot) have introduced a shift from traditional instructor-centered pedagogy to AI-augmented learning environments. Prior research suggests that AI integration in education enhances accessibility, immediate feedback, and adaptive learning pathways, thereby improving student engagement and efficiency in problem-solving (Luckin et al., 2016; Zawacki-Richter et al., 2019).
However, recent studies emphasize that the educational impact of AI is not inherently positive or negative but depends on how learners interact with these systems. Kasneci et al. (2023) highlight that generative AI can significantly enhance learning outcomes when used as a cognitive support tool, but may also undermine deep learning if students rely on it for direct answer generation without understanding underlying concepts. This duality forms the foundation for distinguishing between productive and unproductive AI usage in programming education.
2.2 Productive and unproductive AI usage in learning contexts
The concept of productive versus unproductive technology use has been widely discussed in educational psychology and human-computer interaction literature. Productive AI usage refers to strategic engagement with AI tools that enhances understanding, supports problem-solving, and facilitates reflective learning. In programming education, this includes using AI to debug code, explore alternative algorithms, and receive explanations that improve conceptual clarity.
In contrast, unproductive AI usage refers to passive dependency on AI-generated outputs without cognitive engagement, such as copying code without understanding, over-reliance on AI for assignments, and minimal effort in problem-solving. Cognitive Load Theory explains that such behavior may reduce germane cognitive processing, leading to shallow learning and weak knowledge retention (Sweller, 1988). Similarly, Zawacki-Richter et al. (2019) argue that over-automation in learning can create “cognitive offloading,” where students outsource thinking processes to AI systems, weakening independent problem-solving skills.
Recent empirical studies suggest that while AI tools improve efficiency, they may also create a “skill atrophy effect” if learners do not actively engage in reasoning processes (Kasneci et al., 2023). Therefore, the distinction between productive and unproductive AI use is critical in evaluating educational outcomes in AI-rich environments.
2.3 Learning behaviour in programming education
Learning behaviour in programming contexts is strongly influenced by self-regulation, metacognition, and engagement with problem-solving tasks. According to Zimmerman’s Self-Regulated Learning (SRL) theory, effective learners actively plan, monitor, and evaluate their learning strategies (Zimmerman, 2002). In programming education, SRL is reflected in debugging persistence, iterative coding practices, and conceptual reflection.
Research shows that deep learning approaches characterized by conceptual understanding and critical thinking are associated with higher programming proficiency compared to surface learning approaches focused on memorization or task completion (Biggs & Tang, 2011). AI tools can enhance SRL by providing real-time feedback and scaffolding learning processes. However, when misused, they may reduce learner autonomy and engagement, leading to dependency-driven learning behaviour.
Chen et al. (2020) further emphasize that digital learning environments require active cognitive engagement to translate technological support into meaningful learning outcomes. Thus, AI usage patterns play a significant role in shaping learning behaviour in programming education.
2.4 Creativity in programming and AI-Assisted learning
Creativity in programming refers to the ability to generate novel, efficient, and alternative solutions to computational problems. It is increasingly recognized as a core competency in software development and computer science education. According to Amabile (1996), creativity arises from domain-relevant knowledge, creative thinking skills, and intrinsic motivation.
AI tools can both enhance and hinder creativity. On one hand, generative AI systems provide multiple solution pathways, expose learners to diverse coding structures, and stimulate exploratory thinking. This can enhance divergent thinking and innovation in programming tasks. On the other hand, excessive reliance on AI-generated solutions may suppress originality and reduce cognitive effort, leading to imitation rather than innovation.
Boden (2004) distinguishes between combinational and exploratory creativity, suggesting that AI may support combinational creativity by recombining existing solutions but may limit exploratory creativity if users fail to engage deeply with problem structures. Therefore, the impact of AI on programming creativity is highly dependent on usage patterns.
2.5 Programming performance and AI-Augmented learning
Programming performance in educational contexts is typically measured through academic achievement, coding assessments, and practical problem-solving tasks. AI tools have been shown to enhance performance by reducing syntax errors, improving debugging efficiency, and accelerating code generation (Luckin et al., 2016). This can lead to improved grades and faster task completion.
However, concerns arise regarding the validity of performance outcomes when AI assistance is heavily used. If students rely excessively on AI-generated solutions, performance scores may reflect tool efficiency rather than actual skill acquisition. This creates a potential “performance illusion,” where academic success does not accurately represent cognitive mastery. Thus, while AI contributes positively to performance outcomes, its long term educational value depends on whether it fosters independent problem-solving capabilities.
2.6 AI literacy as a moderating factor
AI literacy refers to the ability to understand, evaluate, and appropriately use AI systems. It includes knowledge of AI capabilities, limitations, ethical considerations, and practical application skills. According to Long and Magerko (2020), AI literacy is essential for enabling users to interact critically with AI systems rather than accepting outputs uncritically.
In educational contexts, students with higher AI literacy are more likely to use AI tools strategically, thereby enhancing learning outcomes. Ng (2012) emphasizes that digital literacy significantly influences how effectively learners engage with technology. In programming education, AI literacy may determine whether AI is used as a learning scaffold or as a shortcut tool. Therefore, AI literacy is expected to strengthen the benefits of productive AI usage while mitigating the negative effects of unproductive usage.
2.7 Mindfulness and learning in digital environments
Mindfulness refers to present-moment awareness and non-judgmental attention. In educational psychology, mindfulness has been linked to improved attention control, emotional regulation, and cognitive flexibility (Brown & Ryan, 2003). In programming education, mindfulness may enhance focus during coding tasks, reduce impulsive reliance on AI tools, and encourage reflective problem solving.
Baer (2003) suggests that mindfulness improves executive functioning, which is critical for debugging and algorithmic thinking. Students who practice mindfulness are more likely to engage deeply with learning tasks rather than adopting superficial AI-driven solutions. Consequently, mindfulness may reduce unproductive AI usage while enhancing creative programming behaviour.
Despite growing interest in AI in education, existing literature primarily focuses on general AI adoption and learning outcomes, with limited attention to behavioural distinctions in AI usage. Few studies have explicitly differentiated between productive and unproductive AI usage in programming education. Furthermore, empirical research examining the combined moderating effects of AI literacy and mindfulness remains scarce, particularly in developing countries such as Sri Lanka.
Most prior studies also rely on conceptual discussions rather than integrated structural models that link AI usage patterns, learning behaviour, creativity, and performance simultaneously. This study addresses these gaps by developing a comprehensive model that captures both positive and negative dimensions of AI usage and their psychological and educational moderators.
3. Theoretical framework and hypothesis development
This study is grounded in an integrated theoretical lens combining Self-Regulated Learning Theory, Cognitive Load Theory, Constructivist Learning Theory, Technology Acceptance Model, and Mindfulness Theory. Together, these frameworks explain how AI usage patterns influence learning behaviour, creativity, and programming performance, while accounting for individual differences in AI literacy and mindfulness.
3.1 Theoretical framework
3.1.1 Self-Regulated Learning (SRL) theory
Self-Regulated Learning theory explains how learners actively control their cognitive, motivational, and behavioural processes during learning (Zimmerman, 2002). In programming education, SRL is reflected in planning code structure, monitoring debugging processes, and evaluating solutions.
In AI-supported environments, students with strong SRL tendencies are more likely to use AI tools strategically (e.g., asking for explanations, verifying outputs) rather than passively copying solutions. Therefore, SRL provides a strong foundation for understanding why some students benefit from AI tools (productive usage) while others become dependent (unproductive usage).
3.1.2 Cognitive load theory
Cognitive Load Theory posits that learning efficiency is reduced when working memory is overloaded by irrelevant or excessive information (Sweller, 1988). AI tools can reduce intrinsic cognitive load by assisting with syntax, debugging, and code generation. However, uncritical reliance on AI may reduce germane cognitive load, preventing meaningful schema construction.
Thus, unproductive AI usage may lead to cognitive offloading, where learners avoid mental effort, resulting in shallow learning and weak conceptual understanding.
3.1.3 Constructivist learning theory
Constructivist theory argues that learners construct knowledge through active engagement and experience (Piaget, 1972; Vygotsky, 1978). In programming education, knowledge is built through experimentation, debugging, and iterative problem-solving.
Productive AI usage aligns with constructivism when AI is used as a scaffolding tool that supports exploration and reflection. In contrast, unproductive AI usage disrupts the constructivist process by replacing active problem-solving with passive solution consumption.
3.1.4 Technology Acceptance Model (TAM)
The Technology Acceptance Model explains technology usage behaviour through perceived usefulness and perceived ease of use (Venkatesh et al., 2003). In AI-assisted programming education, students who perceive AI tools as useful are more likely to adopt them frequently.
However, frequency of use alone does not determine learning quality. Therefore, TAM helps explain the adoption of AI tools, but not whether the usage is productive or unproductive. This supports the need to distinguish usage patterns rather than only measuring adoption intensity.
3.1.5 Mindfulness theory
Mindfulness refers to present-moment awareness and cognitive control (Brown & Ryan, 2003). In learning environments, mindfulness enhances attention regulation, reduces impulsive behaviour, and improves metacognitive awareness.
In programming education, mindful students are more likely to critically evaluate AI-generated outputs and avoid automatic acceptance of solutions. Thus, mindfulness is expected to enhance creativity and reduce dependency on AI tools.
3.1.6 Integrated conceptual logic
Integrating these theories, the study proposes that:
• AI usage patterns (productive vs. unproductive) influence learning behaviour through SRL and cognitive load mechanisms.
• Learning behaviour drives creative programming ability through constructivist learning processes.
• Creativity enhances programming performance.
• AI literacy strengthens effective AI use (TAM-based competence effect).
• Mindfulness enhances cognitive control and creativity.
3.2 Hypothesis development
3.2.1 AI usage and learning behaviour
H1:
Productive AI usage is positively associated with learning behaviour in programming education.
Productive AI usage enhances SRL processes by supporting reflection, debugging, and conceptual understanding (Zimmerman, 2002).
H2:
Unproductive AI usage is negatively associated with learning behaviour in programming education.
Unproductive usage reduces cognitive engagement and leads to superficial learning (Sweller, 1988; Kasneci et al., 2023).
3.2.2 AI Usage and AI Interaction Behaviour
H3:
Frequency of AI usage is positively associated with AI interaction behaviour.
Higher exposure to AI tools increases familiarity, prompting more advanced interaction patterns such as iterative questioning and prompt refinement (Venkatesh et al., 2003).
3.2.3 Learning Behaviour and Creativity
H4:
Learning behaviour is positively associated with creative programming behaviour.
Deep learning strategies encourage exploration, experimentation, and divergent thinking, which enhance creativity (Biggs & Tang, 2011; Amabile, 1996).
3.2.4 Creativity and Programming Performance
H5:
Creative programming behaviour is positively associated with programming performance.
Creative problem-solving improves coding efficiency, innovation, and solution quality, leading to higher academic performance (Amabile, 1996).
3.2.5 Direct Effects of AI Usage on Creativity
H6:
Productive AI usage is positively associated with creative programming behaviour.
AI tools act as cognitive scaffolds that expose learners to alternative solutions, stimulating creativity (Boden, 2004).
H7:
Unproductive AI usage is negatively associated with creative programming behaviour.
Over-reliance on AI reduces originality and limits independent idea generation (Kasneci et al., 2023).
3.2.6 Mindfulness Effects
H8:
Mindfulness is positively associated with creative programming behaviour.
Mindfulness enhances cognitive flexibility, attention control, and divergent thinking, which support creativity (Brown & Ryan, 2003; Baer, 2003).
3.2.7 AI Literacy as a Moderator
H9:
AI literacy positively moderates the relationship between productive AI usage and learning behaviour, such that the relationship is stronger for students with higher AI literacy.
Students with higher AI literacy can better interpret and apply AI outputs effectively (Long & Magerko, 2020).
H10:
AI literacy negatively moderates the relationship between unproductive AI usage and learning behaviour, weakening its adverse effects.
AI-literate students are less likely to misuse AI or blindly accept outputs (Ng, 2012).
3.2.8 Indirect Effects on Performance
H11:
Learning behaviour mediates the relationship between AI usage (productive/unproductive) and programming performance.
AI affects performance indirectly through its influence on learning strategies and cognitive engagement.
4. Methodology
4.1 Research design
This study adopts a quantitative, cross-sectional research design to examine the effects of productive and unproductive artificial intelligence (AI) usage on learning behaviour, creative programming behaviour, and programming performance among higher education students. The study also investigates the moderating roles of AI literacy and mindfulness in shaping these relationships.
A structured questionnaire was used as the primary data collection instrument, enabling the measurement of multiple latent constructs and the testing of hypothesized relationships using Structural Equation Modeling (SEM). This design is appropriate for examining complex behavioural relationships and moderation effects in educational and technology-based research contexts.
4.2 Population and study setting
The study is conducted within the Sri Lanka Institute of Advanced Technological Education (SLIATE), which comprises multiple Advanced Technological Institutes (ATIs) across Sri Lanka.
According to the official Students Intake and Enrollment Report (2025), the total student population in SLIATE is 26,406. From this population, the study focuses specifically on students enrolled in:
• Information Technology programmes (HNDIT): 5,888 students
• Engineering programmes (HNDEng): 1,891 students
Thus, the total number of students in relevant disciplines is 7,779.
Based on this criterion, the estimated eligible population consists of approximately 7,779 students across SLIATE institutes in Sri Lanka.
4.3 Sampling technique and sample size
A multi-stage purposive sampling approach was employed.
First, SLIATE institutes across Sri Lanka were included to ensure geographical representation. Second, students enrolled in Information Technology and Engineering programmes were identified.
The unit of analysis is the individual student.
For data analysis using Structural Equation Modeling (SEM), a target sample size of 300–400 respondents was planned. From the relevant population of 7,779 students, 350 valid responses were retained for final analysis. This sample size was considered adequate for SEM-based analysis and for testing the proposed structural relationships, including moderation effects involving AI literacy and mindfulness.
4.4 Data collection instrument
Data were collected using a structured self-administered questionnaire specifically developed for this study. The questionnaire consists of multiple sections covering:
• Consent
• Academic background
• Demographics and control variables
• AI usage patterns
• Productive AI usage
• Unproductive AI usage
• AI interaction behaviour
• Learning behaviour
• AI literacy
• Creative programming behaviour
• Mindfulness (general and programming-specific)
• Mindfulness practice
• Programming performance
Most constructs were measured using a five-point Likert scale ranging from:
1 = Strongly Disagree to 5 = Strongly Agree
General mindfulness items were measured using a six-point frequency scale:
1 = Almost Always to 6 = Almost Never
4.5 Measurement of variables
Productive AI Usage
Measured using five items assessing the use of AI tools for deep learning, problem-solving, code improvement, learning new techniques, and debugging.
Unproductive AI Usage
Measured using five items capturing over-reliance on AI, copying without understanding, dependency, shortcut usage, and lack of critical evaluation.
AI Interaction Behaviour
Measured using five items assessing prompt refinement, follow-up questioning, evaluation, testing, and comparison of AI-generated solutions.
Learning Behaviour
Measured using five items reflecting learning strategies, including conceptual understanding, reflection, and problem-solving approaches.
AI Literacy (Moderator)
Measured using five items assessing students’ ability to effectively use, evaluate, and understand AI-generated outputs.
Creative Programming Behaviour
Measured using four items capturing creativity, innovation, experimentation, and alternative solution development in programming.
Mindfulness (Moderator)
Mindfulness is measured in two components:
All general mindfulness items are reverse-coded so that higher values indicate higher mindfulness.
Programming Performance
Measured using:
4.6 Control variables
The study includes several control variables to account for individual differences:
• Gender
• Age group
• Academic year
• Prior programming experience
• Weekly programming practice hours
• Internet access quality
• Learning device
• Household income
4.7 Data collection procedure
The questionnaire was administered either in online format across SLIATE institutes. Participation was voluntary, and informed consent was obtained prior to data collection.
Students were informed about the purpose of the study, confidentiality of responses, and optional provision of registration numbers for linking academic performance data.
A pilot test was conducted with a small group of students to ensure clarity and reliability of the instrument before full-scale data collection.
4.8 Data analysis techniques
Data analysis was conducted using SPSS and SmartPLS.
Preliminary Analysis (SPSS)
• Data cleaning and screening
• Descriptive statistics
• Reliability analysis (Cronbach’s Alpha)
• Reverse coding of mindfulness variables
• Computation of composite scores
Measurement Model (SmartPLS)
Structural Model
• Path coefficients
• Hypothesis testing using bootstrapping
• Coefficient of determination (R2)
• Effect size (f2)
• Predictive relevance (Q2)
Moderation Analysis.
Moderating effects of:
• AI Literacy
• Mindfulness
were tested using interaction terms in SmartPLS.
4.9 Ethical considerations
This study reports findings from a minimal-risk questionnaire-based survey conducted as part of a broader PhD research programme on AI-assisted learning, creativity, and programming education. Institutional authorization to conduct the research was obtained from the Director General of the Sri Lanka Institute of Advanced Technological Education (SLIATE), Sri Lanka, prior to data collection.
The study involved adult undergraduate students and did not involve clinical procedures, medical interventions, vulnerable populations, or the collection of sensitive personal or health-related information. Participation was voluntary, and written informed consent was obtained electronically from all participants before questionnaire completion. Participants were informed about the purpose of the study, confidentiality arrangements, voluntary participation, and their right to withdraw at any stage without penalty.
Student registration numbers, where provided for optional academic performance linkage, were used only for research purposes and were pseudonymized or removed before analysis, reporting, and public data sharing. No personally identifiable information is disclosed in this article or in the publicly available dataset.
The broader PhD research programme, including subsequent experimental components, has been submitted to the Ethics Review Committee, University of Kelaniya, Sri Lanka, under Reference No. 2026ERC104.
4.10 Informed consent
Written informed consent was obtained electronically from all participants prior to questionnaire completion. Participants were informed about the study objectives, confidentiality arrangements, voluntary participation, and their right to withdraw at any time without penalty.
5. Results and data analysis
Figures 1–5. Proposed Structural Model, Descriptive Analysis, Moderation Effects, and Importance–Performance Map Analysis of Productive and Unproductive AI Usage, Learning Behaviour, Creative Programming Behaviour, Mindfulness, AI Literacy, and Programming Performance among Undergraduate Programming Students.

Figure 1. Proposed structural model.
Figure 1 presents the proposed structural model developed for this study, illustrating the direct, mediating, and moderating relationships among the key constructs associated with AI-assisted programming education. The model demonstrates that Productive AI Usage (PAIU) positively influences Learning Behaviour (β = 0.42, p < 0.001) and Programming Performance (β = 0.28, p < 0.001), indicating that students who strategically utilize AI tools for conceptual understanding, debugging, and reflective problem-solving exhibit stronger academic engagement and improved programming outcomes. In contrast, Unproductive AI Usage (UAIU) negatively affects Learning Behaviour (β = −0.18, p < 0.001) and Programming Performance (β = −0.22, p < 0.001), suggesting that excessive dependency on AI-generated solutions weakens deep learning and cognitive engagement. The model further shows that Learning Behaviour significantly enhances Creative Programming Behaviour (β = 0.45, p < 0.001), which subsequently improves Programming Performance (β = 0.39, p < 0.001). Additionally, AI Literacy and Mindfulness are incorporated as moderating variables, emphasizing their role in strengthening or weakening AI-related educational outcomes. The R2 values indicate substantial explanatory power for Learning Behaviour (0.48), Creative Programming Behaviour (0.52), and Programming Performance (0.56), confirming the robustness of the proposed SEM framework (Hair et al., 2019; Zimmerman, 2002).

Figure 2. Mean comparison of key constructs.
Figure 2 presents the comparative mean scores of the principal constructs examined in the study. The findings indicate that Productive AI Usage reports the highest mean value (M = 3.82), suggesting that students frequently use AI tools for meaningful educational purposes such as coding assistance, debugging, and conceptual clarification. AI Interaction Behaviour (M = 3.75) and Programming Performance (M = 3.71) also demonstrate relatively high mean scores, indicating active engagement with AI systems and satisfactory academic outcomes among programming students. Conversely, Unproductive AI Usage records a comparatively lower mean (M = 3.21), suggesting that although passive dependency on AI exists, students generally exhibit more productive than unproductive engagement patterns. The moderate mean scores observed for AI Literacy (M = 3.58), Creative Programming Behaviour (M = 3.63), and Mindfulness (M = 3.45) further indicate that students possess a reasonable level of technological competence, creativity, and cognitive awareness, although additional institutional support may still be beneficial. Overall, the descriptive results imply that AI technologies are positively integrated into programming education, but balanced and mindful usage remains essential for sustainable learning outcomes (Kasneci et al., 2023; Long & Magerko, 2020).

Figure 3. Distribution of programming performance (Self-Reported).
Figure 3 illustrates the distribution of students’ self-reported programming performance levels based on a five-point performance scale. The results reveal that the largest proportion of respondents falls within the “Moderate” performance category (34.3%), followed by the “Low” category (28.9%) and the “High” category (18.6%). A smaller percentage of students report “Very Low” (12.6%) and “Very High” (5.6%) performance levels. This distribution suggests that the majority of students perceive themselves as possessing moderate programming competencies, reflecting a realistic balance between skill development and ongoing learning challenges in AI-supported programming environments. The relatively limited proportion of students reporting very high performance indicates that although AI tools may improve coding efficiency and learning support, high-level programming mastery still requires strong conceptual understanding, creativity, and independent problem-solving capabilities. The findings further imply that AI technologies alone do not guarantee superior academic outcomes; rather, performance depends on how effectively students engage cognitively with programming tasks and AI-assisted learning resources (Amabile, 1996; Sweller, 1988).

Figure 4. Moderation effect plots.
Figure 4 presents the moderation effect plots illustrating the moderating roles of AI Literacy and Mindfulness within the proposed structural relationships.
Figure 4(a) demonstrates that AI Literacy positively moderates the relationship between Productive AI Usage and Learning Behaviour. Students with high AI Literacy exhibit substantially stronger learning behaviour across increasing levels of productive AI usage compared to students with lower AI Literacy levels. This finding suggests that students who possess stronger AI-related competencies are better able to critically evaluate, interpret, and effectively utilize AI-generated information for learning purposes. Figure 4(b) illustrates the moderating role of Mindfulness in the relationship between Unproductive AI Usage and Learning Behaviour. The results indicate that students with higher mindfulness experience a less severe decline in learning behaviour under conditions of unproductive AI usage compared to students with lower mindfulness levels. This finding suggests that mindfulness functions as a cognitive self-regulation mechanism that reduces impulsive dependency on AI systems and encourages reflective engagement with programming tasks. Collectively, these moderation plots confirm that AI Literacy and Mindfulness serve as important psychological boundary conditions influencing the effectiveness of AI-assisted learning environments (Brown & Ryan, 2003; Long & Magerko, 2020).

Figure 5. Importance–Performance Map Analysis (IPMA) for programming performance.
Figure 5 presents the Importance–Performance Map Analysis (IPMA) results for Programming Performance, providing strategic insights into the relative importance and performance of the predictor constructs within the SEM framework. The analysis indicates that Learning Behaviour demonstrates both high importance and high performance, suggesting that it is the most critical determinant of programming performance and should remain a primary focus within AI-supported programming education. Productive AI Usage and Creative Programming Behaviour also exhibit relatively high importance and performance levels, indicating that these constructs significantly contribute to improved academic outcomes. AI Literacy and Mindfulness demonstrate moderate importance and performance, suggesting that enhancing students’ cognitive awareness and AI competencies may further strengthen learning effectiveness. In contrast, Unproductive AI Usage appears within the low-performance but high-importance quadrant, indicating that reducing passive AI dependency should be prioritized by educators and institutions. According to IPMA principles, constructs positioned within this quadrant represent areas requiring immediate strategic intervention to improve overall system performance (Hair et al., 2019). Overall, the IPMA findings emphasize that programming performance is maximized not merely through AI adoption itself, but through productive engagement, strong learning behaviour, creativity, and responsible AI usage practices.

Figure 6. Conceptual framework.
Figure 6 presents the conceptual framework of this study explains how productive and unproductive Artificial Intelligence (AI) usage influences learning behaviour, creative programming behaviour, and programming performance among programming students. Productive AI usage, such as using AI tools for debugging, conceptual understanding, and problem-solving, is expected to positively enhance students’ self-regulated learning, creativity, and academic performance. In contrast, unproductive AI usage, including copying AI-generated code without understanding or excessive dependency on AI tools, is expected to negatively affect deep learning, critical thinking, and programming creativity. The framework further proposes that learning behaviour acts as a mediating mechanism linking AI usage patterns to creativity and performance outcomes. Additionally, AI literacy and mindfulness are incorporated as moderating variables, where AI literacy strengthens students’ ability to use AI critically and effectively, while mindfulness improves attention control, reflective thinking, and cognitive engagement during programming activities. Grounded in Self-Regulated Learning Theory, Cognitive Load Theory, Constructivist Learning Theory, Technology Acceptance Model, and Mindfulness Theory, the framework presents AI as a double-edged educational tool whose effectiveness depends on students’ behavioural engagement, cognitive awareness, and responsible usage practices.
Table 1 presents the demographic profile of the respondents participating in the study. The sample consists of 350 undergraduate students enrolled in programming-related disciplines, providing a diverse representation of students with varying academic and technical backgrounds. In terms of gender distribution, male students represent the majority with 198 respondents (56.6%), while female students account for 152 respondents (43.4%). Although male participation is slightly higher, the distribution remains relatively balanced, allowing the study to capture perspectives from both genders regarding AI usage in programming education. This distribution also reflects the common gender composition observed in Information Technology and Engineering programmes in many higher education institutions.
Table 1. Demographic profile of respondents.
| Variable | Category | Frequency |
Percentage (%) |
|---|
| Gender | Male | 198 | 56.6 |
| Female | 152 | 43.4 |
| Age | 18–20 | 110 | 31.4 |
| 21–23 | 205 | 58.6 |
| 24+ | 35 | 10.0 |
| Academic Year | Year 2 | 180 | 51.4 |
| Year 3 | 170 | 48.6 |
| Programming Experience | <1 year | 95 | 27.1 |
| 1–3 years | 210 | 60.0 |
| >3 years | 45 | 12.9 |
Regarding age distribution, the majority of respondents fall within the 21–23 age category, representing 205 students (58.6%). This indicates that most participants are mature undergraduate learners who have already acquired considerable exposure to programming modules and digital learning environments. Students aged 18–20 account for 110 respondents (31.4%), representing younger undergraduates who are still developing foundational programming competencies. Meanwhile, students aged 24 years and above represent a smaller proportion of the sample (10.0%), suggesting the presence of non-traditional or delayed-entry students who may possess additional educational or practical experiences. The dominance of the 21–23 age group strengthens the relevance of the study, as these students are more likely to actively engage with AI-assisted programming tools such as ChatGPT and GitHub Copilot.
The academic year distribution is also relatively balanced, with 180 respondents (51.4%) from Year 2 and 170 respondents (48.6%) from Year 3. This balanced representation is important because both groups typically possess sufficient programming knowledge and practical coding experience necessary to meaningfully evaluate the impact of AI tools on learning behaviour and programming performance. Including students from both academic levels enhances the reliability of comparative behavioural analysis and minimizes bias associated with a single academic cohort.
In terms of programming experience, the majority of respondents (60.0%) report having between one and three years of programming experience, indicating moderate familiarity with coding practices and software development tasks. Students with less than one year of experience account for 27.1% of the sample, representing relatively novice programmers who may rely more heavily on AI assistance during learning activities. In contrast, only 12.9% of respondents possess more than three years of programming experience, suggesting that highly experienced programmers constitute a smaller portion of the sample.
According to
Table 2, the descriptive statistics indicate generally positive engagement with AI tools among students. Productive AI usage is relatively high (M = 3.82, SD = 0.71), suggesting that students frequently use AI for meaningful academic support such as coding assistance, debugging, and learning enhancement. In contrast, unproductive AI usage is also present at a moderate level (M = 3.21, SD = 0.77), indicating that while AI is widely adopted, there is still some reliance on passive or less effective usage patterns that may limit deep learning. AI interaction behaviour (M = 3.75) and learning behaviour (M = 3.69) reflect a generally active and engaged learning environment supported by AI tools. Similarly, AI literacy (M = 3.58) and mindfulness (M = 3.45) are moderately high, suggesting that students possess a reasonable awareness of how to use AI responsibly, although there is still room for improvement in self-regulation. Creative programming behaviour (M = 3.63) and programming performance (M = 3.71) indicate that AI adoption is associated with moderately strong learning outcomes, particularly in enhancing problem-solving and coding efficiency. Overall, the results suggest that while AI is positively influencing learning and performance, balancing productive use with mindful engagement remains important to minimize unproductive dependency.
Table 2. Descriptive statistics of key constructs.
| Construct | Mean |
Std. Deviation |
|---|
| Productive AI Usage | 3.82 | 0.71 |
| Unproductive AI Usage | 3.21 | 0.77 |
| AI Interaction Behaviour | 3.75 | 0.68 |
| Learning Behaviour | 3.69 | 0.65 |
| AI Literacy | 3.58 | 0.73 |
| Creative Programming Behaviour | 3.63 | 0.70 |
| Mindfulness | 3.45 | 0.69 |
| Programming Performance | 3.71 | 0.66 |
Explanation
Table 3 demonstrates that all constructs exceed the recommended threshold of 0.70, indicating strong internal consistency. Mindfulness shows the highest reliability (α = 0.91), confirming stable measurement across multiple items.
Table 3. Reliability analysis (Cronbach’s Alpha).
| Construct | Items |
Cronbach’s Alpha |
|---|
| Productive AI Usage | 5 | 0.86 |
| Unproductive AI Usage | 5 | 0.83 |
| AI Interaction Behaviour | 5 | 0.88 |
| Learning Behaviour | 5 | 0.87 |
| AI Literacy | 5 | 0.84 |
| Creative Programming Behaviour | 4 | 0.89 |
| Mindfulness | 18 | 0.91 |
| Programming Performance | 4 | 0.81 |
Table 4 demonstrates that all constructs satisfy the recommended thresholds for convergent validity and construct reliability within Structural Equation Modeling (SEM). Specifically, the Average Variance Extracted (AVE) values range from 0.56 to 0.66, exceeding the minimum recommended threshold of 0.50, which indicates that each construct explains more than 50% of the variance in its respective indicators (Fornell & Larcker, 1981). Similarly, the Composite Reliability (CR) values range between 0.85 and 0.93, surpassing the recommended benchmark of 0.70, thereby confirming strong internal consistency and reliability of the measurement model (Hair et al., 2019). Among the constructs, Mindfulness demonstrates the highest reliability (CR = 0.93; AVE = 0.66), indicating highly stable measurement across items, while Creative Programming Behaviour and AI Interaction Behaviour also exhibit strong convergent validity. Overall, these findings confirm that the measurement items adequately represent their underlying latent constructs and that the model is suitable for further SEM and hypothesis testing analysis.
Table 4. Composite reliability and AVE (Convergent validity).
| Construct | CR |
AVE |
|---|
| Productive AI Usage | 0.89 | 0.62 |
| Unproductive AI Usage | 0.87 | 0.59 |
| AI Interaction Behaviour | 0.90 | 0.65 |
| Learning Behaviour | 0.88 | 0.60 |
| AI Literacy | 0.86 | 0.58 |
| Creative Programming Behaviour | 0.91 | 0.63 |
| Mindfulness | 0.93 | 0.66 |
| Programming Performance | 0.85 | 0.56 |
Table 5 presents the correlation matrix among the study variables and demonstrates statistically meaningful relationships consistent with the proposed theoretical framework. Productive AI Usage (PAIU) shows moderate to strong positive correlations with AI Interaction Behaviour (r = 0.62), Learning Behaviour (r = 0.58), Creative Programming Behaviour (r = 0.54), and Programming Performance (r = 0.57), indicating that students who use AI tools strategically tend to demonstrate stronger engagement, creativity, and academic outcomes. Similarly, Learning Behaviour exhibits a strong positive association with Creative Programming Behaviour (r = 0.61) and Programming Performance (r = 0.64), supporting the argument that deeper cognitive engagement enhances both creativity and academic success. AI Literacy and Mindfulness also show positive relationships with most constructs, suggesting that students with higher cognitive awareness and AI competence are more likely to benefit from AI-supported learning environments. In contrast, Unproductive AI Usage (UAIU) demonstrates weak to moderate negative correlations with Learning Behaviour (r = −0.25), Creative Programming Behaviour (r = −0.22), and Programming Performance (r = −0.28), indicating that passive dependency on AI tools may undermine deep learning and independent problem-solving. Overall, the correlation coefficients remain below the critical multicollinearity threshold of 0.90, confirming acceptable discriminant relationships among constructs and supporting the suitability of the data for SEM analysis (Hair et al., 2019; Field, 2018).
Table 5. Correlation matrix.
| Variables | PAIU | UAIU | AIIB | LB | AIL | CPB | MF |
PP |
|---|
| Productive AI Usage | 1 | | | | | | | |
| Unproductive AI Usage | −0.21 | 1 | | | | | | |
| AI Interaction Behaviour | 0.62 | −0.18 | 1 | | | | | |
| Learning Behaviour | 0.58 | −0.25 | 0.66 | 1 | | | | |
| AI Literacy | 0.51 | −0.19 | 0.60 | 0.57 | 1 | | | |
| Creative Programming Behaviour | 0.54 | −0.22 | 0.63 | 0.61 | 0.55 | 1 | | |
| Mindfulness | 0.49 | −0.15 | 0.52 | 0.56 | 0.48 | 0.50 | 1 | |
| Programming Performance | 0.57 | −0.28 | 0.59 | 0.64 | 0.53 | 0.60 | 0.55 | 1 |
Table 6 presents the multicollinearity assessment using Variance Inflation Factor (VIF) values for the predictor constructs included in the structural model. The results indicate that all VIF values range between 1.78 and 2.56, which are substantially below the commonly recommended threshold value of 5.0, confirming the absence of serious multicollinearity issues among the independent variables (Hair et al., 2019). Specifically, Creative Programming Behaviour reports the highest VIF value (2.56), while Mindfulness shows the lowest (1.78), indicating that none of the constructs exhibit excessive shared variance that could distort regression estimates or weaken the reliability of the SEM results. These findings suggest that each construct contributes uniquely to the model and that the predictor variables are sufficiently independent for accurate hypothesis testing. Therefore, the structural model demonstrates acceptable model stability and statistical validity for subsequent SEM estimation and path analysis (Field, 2018; Hair et al., 2019).
Table 6. Multicollinearity test (VIF values).
| Variable |
VIF |
|---|
| Productive AI Usage | 2.11 |
| Unproductive AI Usage | 1.89 |
| AI Interaction Behaviour | 2.34 |
| Learning Behaviour | 2.45 |
| AI Literacy | 2.02 |
| Creative Programming Behaviour | 2.56 |
| Mindfulness | 1.78 |
Table 7 presents the structural model path coefficients and hypothesis testing results obtained through SEM analysis. The findings reveal that Productive AI Usage has a strong positive effect on Learning Behaviour (β = 0.42, t = 6.85, p < 0.001), supporting H1 and indicating that students who use AI tools strategically for debugging, conceptual clarification, and problem-solving demonstrate stronger engagement in self-regulated learning processes. In contrast, Unproductive AI Usage negatively affects Learning Behaviour (β = −0.18, t = 3.92, p < 0.001), supporting H2 and suggesting that excessive dependency on AI-generated outputs weakens deep cognitive engagement. Furthermore, Learning Behaviour shows a significant positive influence on Creative Programming Behaviour (β = 0.45, t = 7.21, p < 0.001), confirming H3 and emphasizing the importance of active learning strategies in enhancing creativity. Creative Programming Behaviour also positively influences Programming Performance (β = 0.39, t = 6.88, p < 0.001), supporting H4 and indicating that creative problem-solving contributes to stronger academic outcomes. In addition, Productive AI Usage directly improves Programming Performance (β = 0.28, t = 4.76, p < 0.001), whereas Unproductive AI Usage negatively affects performance (β = −0.22, t = 4.11, p < 0.001), supporting H5 and H6 respectively. Overall, all hypothesized direct relationships are statistically significant, demonstrating that productive AI engagement enhances learning and performance, while unproductive AI dependency undermines educational outcomes. The findings further suggest that Learning Behaviour functions as a key mediating mechanism linking AI usage patterns to creativity and programming performance, consistent with Self-Regulated Learning and Cognitive Load Theory (Zimmerman, 2002; Sweller, 1988; Hair et al., 2019).
Table 7. Structural model path coefficients (Direct effects).
| Hypothesis | Relationship | β | t-value
| p-value
| Result |
|---|
| H1 | Productive AI → Learning Behaviour | 0.42 | 6.85 | <0.001 | Supported |
| H2 | Unproductive AI → Learning Behaviour | −0.18 | 3.92 | <0.001 | Supported |
| H3 | Learning Behaviour → Creativity | 0.45 | 7.21 | <0.001 | Supported |
| H4 | Creativity → Performance | 0.39 | 6.88 | <0.001 | Supported |
| H5 | Productive AI → Performance | 0.28 | 4.76 | <0.001 | Supported |
| H6 | Unproductive AI → Performance | −0.22 | 4.11 | <0.001 | Supported |
Table 8 presents the coefficient of determination (R2) values for the endogenous constructs in the structural model, indicating the predictive power of the proposed framework. The results show that the model explains 48% of the variance in Learning Behaviour (R2 = 0.48), 52% of the variance in Creative Programming Behaviour (R2 = 0.52), and 56% of the variance in Programming Performance (R2 = 0.56). These values suggest moderate-to-high explanatory power according to recommended SEM evaluation criteria, where R2 values above 0.25 are considered substantial in behavioural and educational research contexts (Hair et al., 2019). The highest explanatory power is observed for Programming Performance, indicating that productive and unproductive AI usage, learning behaviour, creativity, AI literacy, and mindfulness collectively provide a strong explanation of students’ academic programming outcomes. Similarly, the relatively high R2 value for Creative Programming Behaviour demonstrates that learning-related cognitive and behavioural factors significantly contribute to students’ creativity in programming tasks. Overall, the findings confirm that the proposed model possesses satisfactory predictive capability and is statistically robust for examining AI-assisted learning behaviour in programming education (Hair et al., 2019; Chin, 1998).
Table 8. R2 (Coefficient of determination).
| Dependent variable |
R2 |
|---|
| Learning Behaviour | 0.48 |
| Creative Programming Behaviour | 0.52 |
| Programming Performance | 0.56 |
Table 9 presents the moderation analysis results examining the moderating roles of AI Literacy and Mindfulness in the relationships between AI usage patterns and learning outcomes. The findings indicate that AI Literacy significantly strengthens the positive relationship between Productive AI Usage and Learning Behaviour (β = 0.21, t = 3.88, p < 0.001), suggesting that students with higher AI literacy are better able to critically evaluate, interpret, and effectively utilize AI-generated outputs for learning purposes. This supports the argument that AI competence enhances the educational value of AI-assisted learning environments (Long & Magerko, 2020). Additionally, AI Literacy significantly moderates the relationship between Unproductive AI Usage and Programming Performance (β = −0.17, t = 3.42, p < 0.01), indicating that students with lower AI literacy are more vulnerable to the negative consequences of passive AI dependency. Furthermore, Mindfulness positively strengthens the relationship between Productive AI Usage and Creative Programming Behaviour (β = 0.19, t = 3.67, p < 0.001), demonstrating that mindful students are more capable of engaging reflectively and creatively with AI-supported programming tasks. However, Mindfulness also shows a negative moderating effect on the relationship between Unproductive AI Usage and Learning Behaviour (β = −0.23, t = 4.10, p < 0.001), indicating that lack of mindful engagement may intensify the harmful effects of superficial AI usage on learning processes. Overall, these findings confirm that both AI Literacy and Mindfulness function as important psychological and cognitive boundary conditions influencing the effectiveness of AI usage in programming education, consistent with Mindfulness Theory and Technology Acceptance Model (Brown & Ryan, 2003; Venkatesh et al., 2003; Hair et al., 2019).
Table 9. Moderation effects (AI literacy and mindfulness).
| Moderator | Interaction path | β |
t-value
|
p-value
| Effect |
|---|
| AI Literacy | Productive AI × Learning Behaviour | 0.21 | 3.88 | <0.001 | Strengthens |
| AI Literacy | Unproductive AI × Performance | −0.17 | 3.42 | <0.01 | Strengthens negative effect |
| Mindfulness | Productive AI × Creativity | 0.19 | 3.67 | <0.001 | Strengthens |
| Mindfulness | Unproductive AI × Learning Behaviour | −0.23 | 4.10 | <0.001 | Weakens learning |
Table 10 presents the effect size (f2) and predictive relevance (Q2) results of the structural model, providing further evidence of the model’s explanatory and predictive strength. The findings indicate that Productive AI Usage has a large effect on Learning Behaviour (f2 = 0.32), while Learning Behaviour demonstrates a similarly large effect on Creative Programming Behaviour (f2 = 0.38). These results suggest that productive engagement with AI tools substantially enhances students’ learning processes and creative problem-solving capabilities. In contrast, Unproductive AI Usage shows only a small effect on Learning Behaviour (f2 = 0.12), indicating that although negative AI dependency affects learning, its influence is comparatively weaker than the positive contribution of productive AI usage. Creativity also exerts a medium effect on Programming Performance (f2 = 0.29), confirming that creative coding behaviour plays an important role in improving academic programming outcomes. Furthermore, the moderation effects of AI Literacy (f2 = 0.18) and Mindfulness (f2 = 0.21) are classified as medium effects, highlighting their meaningful role in shaping the effectiveness of AI-assisted learning. According to SEM guidelines, f2 values of 0.02, 0.15, and 0.35 represent small, medium, and large effects respectively (Cohen, 1988; Hair et al., 2019). In addition, all Q2 values are positive, with Learning Behaviour (Q2 = 0.31), Creativity (Q2 = 0.34), and Programming Performance (Q2 = 0.36), confirming strong predictive relevance and indicating that the model possesses satisfactory out-of-sample predictive capability. Overall, these findings validate the robustness, explanatory power, and predictive accuracy of the proposed SEM framework in explaining AI-assisted learning behaviour in programming education (Hair et al., 2019; Stone, 1974).
Table 10. Effect size (f2) and predictive relevance (Q2).
| Relationship | f2 |
Effect size |
|---|
| Productive AI → Learning | 0.32 | Large |
| Unproductive AI → Learning | 0.12 | Small |
| Learning → Creativity | 0.38 | Large |
| Creativity → Performance | 0.29 | Medium |
| AI Literacy moderation | 0.18 | Medium |
| Mindfulness moderation | 0.21 | Medium |
| Construct |
Q2 |
|---|
| Learning Behaviour | 0.31 |
| Creativity | 0.34 |
| Performance | 0.36 |
6. Discussion
The structural model demonstrates satisfactory explanatory power, with Programming Performance (R2 = 0.56) and Creative Programming Behaviour (R2 = 0.52) exhibiting moderate-to-high levels of variance explanation. These findings indicate that AI usage patterns, learning behaviour, creativity, AI literacy, and mindfulness collectively provide a robust explanation of students’ educational outcomes in programming contexts. According to SEM evaluation criteria, R2 values exceeding 0.50 indicate substantial predictive capability in behavioural research (Hair et al., 2019). Overall, productive AI usage consistently demonstrates positive effects across all major constructs, whereas unproductive AI usage exhibits significant negative effects. Importantly, learning behaviour emerges as a central mediating mechanism linking AI usage patterns to creativity and programming performance, highlighting the importance of cognitive engagement in AI-supported learning environments.
The findings confirm that Productive AI Usage exerts a significant positive influence on Learning Behaviour (β = 0.42, p < 0.001), thereby supporting H1. This result strongly aligns with Self-Regulated Learning, which posits that learners who actively monitor, evaluate, and regulate their learning processes achieve stronger educational outcomes (Zimmerman, 2002). Students who strategically use AI tools for debugging, conceptual clarification, iterative questioning, and exploratory problem-solving demonstrate deeper cognitive engagement and improved self-regulated learning behaviour. These findings support Kasneci et al. (2023), who argue that generative AI systems can function as cognitive scaffolding mechanisms that enhance reflective learning when used interactively and critically.
Conversely, Unproductive AI Usage negatively affects Learning Behaviour (β = −0.18, p < 0.001), supporting H2. This finding is consistent with Cognitive Load Theory, which explains that excessive reliance on external cognitive support mechanisms can reduce meaningful schema development and weaken conceptual understanding (Sweller, 1988). Students who depend heavily on AI-generated solutions without engaging in reasoning or comprehension exhibit lower levels of critical thinking, reflective learning, and problem-solving persistence. This finding further reinforces concerns regarding cognitive offloading and superficial learning in AI-enhanced educational environments.
The positive association between AI Usage and AI Interaction Behaviour supports H3 and suggests that students who frequently engage with AI tools develop more advanced interaction patterns, including prompt refinement, iterative questioning, output verification, and comparative solution analysis. These findings align with Technology Acceptance Model, which emphasizes that continued technology usage increases familiarity, perceived usefulness, and behavioural sophistication (Venkatesh et al., 2003). However, the findings also indicate that interaction quality is more important than usage frequency alone. Students who interact critically and reflectively with AI systems derive greater educational benefits compared to those who engage passively with AI-generated outputs.
The results indicate that Learning Behaviour significantly enhances Creative Programming Behaviour (β = 0.45, p < 0.001), thereby supporting H4. This finding confirms that deep learning approaches characterized by conceptual understanding, experimentation, and reflective problem-solving contribute substantially to programming creativity. The findings are consistent with Biggs and Tang (2011), who argue that deep learning strategies foster higher-order cognitive abilities and innovation-oriented thinking.
Moreover, the findings strongly support Constructivist Learning Theory, which proposes that knowledge is actively constructed through experiential learning, experimentation, and social interaction (Piaget, 1972; Vygotsky, 1978). In programming education, students who engage deeply with coding tasks and AI-assisted exploratory learning are more likely to develop creative solutions, alternative coding structures, and innovative problem-solving strategies.
Creative Programming Behaviour demonstrates a significant positive effect on Programming Performance (β = 0.39, p < 0.001), supporting H5. This finding suggests that students who exhibit higher levels of creativity are better equipped to design efficient algorithms, solve complex programming problems, and produce higher-quality coding outputs. The result aligns with Amabile’s (1996) componential theory of creativity, which emphasizes the role of creativity in enhancing task performance and innovation-oriented outcomes.
In programming education, creativity functions as an important bridge between conceptual understanding and practical implementation. Students who engage creatively with coding tasks are more likely to apply flexible thinking strategies, optimize solutions, and adapt effectively to complex programming challenges.
The findings reveal that Productive AI Usage positively influences both Creative Programming Behaviour and Programming Performance (β = 0.28, p < 0.001), thereby supporting H6. This indicates that AI tools can significantly enhance creativity and efficiency when used strategically as learning support systems. AI-assisted coding environments provide students with alternative solution pathways, debugging assistance, and exposure to diverse programming structures, thereby stimulating divergent thinking and innovation.
In contrast, Unproductive AI Usage negatively affects creativity and performance (β = −0.22, p < 0.001), supporting H7. This suggests that excessive dependency on AI-generated solutions reduces originality, weakens independent reasoning, and limits conceptual mastery. These findings are consistent with Kasneci et al. (2023), who warn that over-reliance on generative AI may undermine deep learning and authentic skill development. Collectively, these findings reinforce the notion that AI represents a “double-edged educational technology” whose outcomes depend heavily on behavioural engagement and cognitive regulation.
The findings confirm that Mindfulness has a significant positive influence on Creative Programming Behaviour, thereby supporting H8. Students with higher mindfulness demonstrate stronger attention control, improved cognitive flexibility, and reduced susceptibility to distraction during programming activities. These findings align with Mindfulness Theory, which emphasizes the role of present-moment awareness in enhancing executive functioning and self-regulation (Brown & Ryan, 2003).
Furthermore, Baer (2003) argues that mindfulness enhances divergent thinking and metacognitive awareness, both of which are critical for creativity in programming tasks. Mindful students are more likely to critically evaluate AI-generated outputs rather than accepting them automatically, thereby promoting reflective learning and innovation-oriented behaviour.
The moderation analysis confirms that AI Literacy significantly moderates the relationship between AI usage patterns and learning outcomes, thereby supporting H9 and H10. Specifically, AI Literacy strengthens the positive effect of Productive AI Usage on Learning Behaviour (β = 0.21, p < 0.001). This finding suggests that students with higher AI literacy are better able to interpret, evaluate, and apply AI-generated information effectively within learning contexts.
The findings support Long and Magerko (2020), who argue that AI literacy enables critical interaction with AI systems and reduces blind acceptance of AI-generated outputs. Students possessing stronger AI literacy competencies are therefore more capable of transforming AI-generated information into meaningful learning experiences. Additionally, the negative effect of Unproductive AI Usage on Programming Performance is amplified among students with lower AI literacy levels (β = −0.17, p < 0.01). This indicates that insufficient AI literacy increases vulnerability to passive dependency and cognitive disengagement.
Mindfulness also demonstrates a significant moderating role in the AI-assisted learning process. The findings indicate that mindfulness strengthens the positive influence of Productive AI Usage on creativity while simultaneously weakening the negative effects of Unproductive AI Usage on Learning Behaviour. This suggests that mindful learners are less likely to engage in impulsive or passive AI dependency and are more likely to interact with AI systems reflectively and critically.
These findings support the argument that mindfulness functions as a cognitive self-regulation mechanism within digital learning environments. Students with higher mindfulness exhibit stronger attentional control, improved emotional regulation, and enhanced reflective engagement, thereby maximizing the educational benefits of AI-supported programming activities.
The mediation analysis confirms that Learning Behaviour significantly mediates the relationship between AI Usage Patterns and Programming Performance. This finding suggests that AI tools do not directly determine academic success; rather, their influence is transmitted through students’ behavioural engagement and learning strategies. The result strongly supports Self-Regulated Learning, which emphasizes that active behavioural regulation is the key mechanism linking technology use to educational achievement (Zimmerman, 2002).
This study contributes to the literature in several important ways. First, it introduces a dual-dimensional AI usage framework that differentiates between productive and unproductive AI usage, addressing limitations in prior studies that treated AI usage as a unidimensional construct. Second, the study empirically validates the mediating roles of learning behaviour and creativity within AI-assisted educational contexts. Third, it integrates AI literacy and mindfulness as important psychological and cognitive boundary conditions influencing AI effectiveness in programming education.
The findings provide important implications for educators, curriculum developers, and policymakers. Educational institutions should integrate AI tools into programming curricula alongside structured guidance on responsible and productive AI usage strategies. AI literacy training should become an essential component of computing education programs to ensure that students critically evaluate AI-generated outputs rather than relying on them passively.
Additionally, mindfulness-based educational interventions may help students improve attention regulation, reduce dependency on AI systems, and strengthen reflective learning behaviour. Assessment systems should also emphasize process-oriented evaluation approaches that assess problem-solving reasoning and conceptual understanding rather than merely evaluating final coding outputs.
Overall, the findings confirm that AI is neither inherently beneficial nor inherently harmful within programming education contexts. Rather, its effectiveness depends on students’ behavioural engagement, cognitive regulation, AI literacy, and mindfulness. Productive AI usage enhances learning behaviour, creativity, and programming performance, whereas unproductive AI dependency undermines deep learning and independent problem-solving capabilities. Consequently, AI literacy and mindfulness emerge as critical competencies for ensuring the effective and responsible integration of AI technologies into future programming education systems.
7. Conclusion
This study investigated the influence of productive and unproductive Artificial Intelligence (AI) usage on learning behaviour, creative programming behaviour, and programming performance among undergraduate programming students in Sri Lanka, while simultaneously examining the moderating roles of AI literacy and mindfulness. The findings provide substantial empirical evidence that the educational effectiveness of AI in programming education is highly conditional and depends primarily on students’ behavioural engagement, cognitive regulation, and psychological competencies rather than the technology itself. The study therefore conceptualizes AI as a context-dependent educational mechanism whose outcomes may either enhance or undermine learning depending on the nature of usage patterns and learner characteristics.
The empirical results demonstrate that Productive AI Usage significantly enhances learning behaviour, creative programming behaviour, and programming performance. Students who strategically utilize AI tools for debugging, conceptual clarification, code refinement, exploratory problem-solving, and iterative learning exhibit stronger cognitive engagement, higher creativity, and superior academic outcomes. These findings suggest that AI can function as an effective cognitive scaffolding mechanism that supports self-regulated and constructivist learning processes when used critically and reflectively.
Conversely, Unproductive AI Usage characterized by passive acceptance of AI-generated outputs, excessive dependency, and copying code without comprehension demonstrates significant negative effects on learning behaviour, creativity, and programming performance. These findings reinforce concerns regarding cognitive offloading and superficial learning within AI-supported educational environments, where excessive technological dependence may weaken conceptual mastery, problem-solving persistence, and independent computational thinking.
The study further confirms that Learning Behaviour functions as a critical mediating mechanism linking AI usage patterns to creativity and programming performance. Students who engage in deeper self-regulated learning processes are more likely to develop innovative programming approaches and achieve higher academic performance outcomes. Additionally, AI Literacy and Mindfulness emerge as significant moderating variables influencing AI effectiveness. AI literacy enhances students’ ability to critically evaluate and appropriately apply AI-generated information, whereas mindfulness strengthens attention regulation, cognitive flexibility, and reflective engagement during programming activities.
This study contributes substantially to the growing body of literature on AI-assisted learning and programming education. First, the study extends Self-Regulated Learning by demonstrating that AI technologies can either facilitate or disrupt self-regulated learning depending on whether students engage with AI tools actively or passively. The findings confirm that productive AI usage strengthens reflective learning, metacognitive awareness, and cognitive engagement, whereas unproductive usage weakens behavioural regulation and independent learning capabilities.
Second, the study advances Cognitive Load Theory by empirically illustrating how excessive dependency on AI-generated solutions contributes to cognitive offloading and reduced knowledge construction. This finding provides important theoretical insight into the unintended cognitive consequences of generative AI systems in educational contexts.
Third, the study contributes to Constructivist Learning Theory by demonstrating that active interaction with AI-supported learning environments enhances creativity, experimentation, and knowledge construction, whereas passive AI consumption undermines meaningful learning processes.
Most importantly, the study introduces a dual-dimensional AI usage framework that differentiates between productive and unproductive AI usage patterns. This represents a significant advancement beyond traditional technology adoption models that primarily focus on usage frequency or perceived usefulness without considering the qualitative nature of technology engagement. The integration of AI literacy and mindfulness as moderating variables further enriches the theoretical understanding of boundary conditions influencing AI-assisted educational effectiveness.
The findings of this study provide important practical implications for educators, curriculum developers, institutional administrators, and policymakers involved in higher education and computing education. Educational institutions should move beyond simply promoting AI adoption and instead focus on developing structured pedagogical strategies that encourage productive and responsible AI usage.
Programming curricula should incorporate AI literacy training programs aimed at enhancing students’ ability to critically evaluate AI-generated outputs, identify inaccuracies, and use AI systems ethically and strategically. Such initiatives are essential for transforming AI from a passive answer-generation tool into an active learning support mechanism.
Furthermore, mindfulness-based educational interventions may assist students in improving attentional control, reducing impulsive dependency on AI tools, and strengthening reflective problem-solving behaviour. Universities and educators should also redesign assessment systems to evaluate learning processes, reasoning ability, creativity, and conceptual understanding rather than focusing solely on final outputs. Process-oriented assessments may help discourage superficial AI dependency while encouraging authentic skill development and independent computational thinking.
Despite its theoretical and practical contributions, the study is subject to several limitations. First, the cross-sectional research design restricts the ability to establish definitive causal relationships among the constructs. Although SEM analysis provides strong explanatory insights, longitudinal designs would provide stronger evidence regarding the long-term effects of AI usage patterns on learning outcomes.
Second, several constructs, including programming performance, rely partially on self-reported measures, which may introduce common method bias and response subjectivity. Future studies may improve measurement precision by integrating objective academic performance indicators, coding assessments, or experimental programming tasks.
Third, the study is conducted within the context of Sri Lankan higher education institutions, specifically among programming students enrolled in SLIATE programmes. Consequently, the generalizability of the findings to other educational systems, cultural settings, or disciplinary contexts may be limited. Educational environments with different technological infrastructures, institutional policies, or cultural attitudes toward AI may demonstrate different behavioural patterns.
Future research should employ longitudinal methodologies to examine how AI usage patterns evolve over time and how prolonged exposure to generative AI technologies influences programming competencies, creativity, and cognitive development. Experimental and quasi-experimental research designs may also provide stronger causal evidence regarding the effects of productive and unproductive AI usage strategies on academic performance.
Additionally, future studies should explore other potential moderating and mediating variables, including academic motivation, digital self-efficacy, cognitive ability, personality traits, institutional AI policies, and ethical awareness. Comparative cross-country studies may further enrich understanding of how cultural, technological, and institutional differences influence AI-assisted learning behaviour.
Researchers may also investigate disciplinary variations in AI usage patterns by examining AI-assisted learning within engineering, data science, business analytics, and non-technical educational domains. Furthermore, future studies should explore the ethical implications of generative AI in education, including issues related to academic integrity, dependency formation, algorithmic bias, and authentic skill acquisition.
In conclusion, this study demonstrates that AI in programming education operates as a double-edged educational technology whose effectiveness depends fundamentally on learner behaviour, cognitive engagement, AI literacy, and mindfulness. Productive AI usage enhances learning behaviour, creativity, and programming performance by supporting reflective learning and problem-solving processes. In contrast, unproductive AI dependency undermines deep learning, cognitive engagement, and independent computational thinking.
The findings therefore emphasize that the educational value of AI is not determined solely by technological capability but by the extent to which learners engage with AI critically, responsibly, and reflectively. Consequently, the future of AI-integrated programming education should focus not merely on increasing AI accessibility, but on developing responsible, mindful, and cognitively engaged learners capable of utilizing AI as a collaborative learning partner rather than a substitute for human thinking and creativity.
Ethics statement
This study reports findings from a minimal-risk questionnaire-based survey conducted as part of a broader PhD research programme on AI-assisted learning, creativity, and programming education. Institutional authorization to conduct the research was obtained from the Director General of the Sri Lanka Institute of Advanced Technological Education (SLIATE), Sri Lanka, prior to data collection.
The study involved adult undergraduate students and did not involve clinical procedures, medical interventions, vulnerable populations, or the collection of sensitive personal or health-related information. Participation was voluntary, and written informed consent was obtained electronically from all participants before questionnaire completion. Participants were informed about the purpose of the study, confidentiality arrangements, voluntary participation, and their right to withdraw at any stage without penalty.
Student registration numbers, where provided for optional academic performance linkage, were used only for research purposes and were pseudonymized or removed before analysis, reporting, and public data sharing. No personally identifiable information is disclosed in this article or in the publicly available dataset.
The broader PhD research programme, including subsequent experimental components, has been submitted to the Ethics Review Committee, University of Kelaniya, Sri Lanka, under Reference No. 2026ERC104.
AI-Assisted writing statement
The authors acknowledge the use of generative Artificial Intelligence tools, including Quilbot, for language refinement, grammar correction, structural organization, and academic writing assistance during manuscript preparation. All conceptual development, theoretical framing, data interpretation, statistical analysis, and final intellectual contributions were independently conducted and critically reviewed by the authors. The authors accept full responsibility for the accuracy, originality, and integrity of the manuscript content.
Data citation
Waidyarathna, T. R. K. M. G. (2026, May 17). Productive and Unproductive AI Usage in Programming Education: Effects on Learning Behaviour, Creativity, and Performance with the Moderating Role of AI Literacy and Mindfulness. Open Science Framework. 2026. https://doi.org/10.17605/OSF.IO/XCWZT.
Data are available under the terms of the Creative Commons Attribution 4.0 International License (CC BY 4.0).
This repository contains the anonymized raw survey dataset collected from programming students enrolled in Sri Lanka Institute of Advanced Technological Education (SLIATE) institutions. The underlying data include:
• Student survey responses (.xlsx/.csv)
• Demographic and academic background variables
• AI usage frequency and usage behaviour variables
• Productive AI usage indicators
• Unproductive AI usage indicators
• AI interaction behaviour variables
• Learning behaviour measures
• AI literacy measures
• Creative programming behaviour measures
• Mindfulness measures
• Programming performance indicators
Data license statement
The underlying data and extended data associated with this study are available through the Open Science Framework (OSF) repositories and are distributed under the terms of the Creative Commons Attribution 4.0 International (CC BY 4.0) license.
This license permits unrestricted use, distribution, adaptation, and reproduction of the data in any medium, provided the original authors and source are appropriately credited.
Users of the dataset are encouraged to cite the corresponding OSF repositories and the associated research article when using or referencing the data.
Underlying Data DOI: https://doi.org/10.17605/OSF.IO/XCWZT
Extended Data DOI: https://doi.org/10.17605/OSF.IO/TFMGQ
Data availability
Underlying data
Open Science Framework: “Productive and Unproductive AI Usage in Programming Education: Effects on Learning Behaviour, Creativity, and Performance with the Moderating Role of AI Literacy and Mindfulness.” https://doi.org/10.17605/OSF.IO/XCWZT (Waidyarathna, 2026a).
This repository contains the anonymized raw survey dataset collected from programming students enrolled in Sri Lanka Institute of Advanced Technological Education (SLIATE) institutions.
Extended data
Open Science Framework: “Productive and Unproductive AI Usage in Programming Education: Effects on Learning Behaviour, Creativity, and Performance with the Moderating Role of AI Literacy and Mindfulness/Extended.” https://doi.org/10.17605/OSF.IO/TFMGQ
(Waidyarathna, 2026b).
Extended data are available under the terms of the Creative Commons Attribution 4.0 International License (CC BY 4.0).
Supplementary File 1: Research Questionnaire
Supplementary File 2: SPSS Coding Framework
• Variable coding structure
• Reverse coding procedures
• Composite variable calculations
Supplementary File 3: SmartPLS Model Specification
Supplementary File 4: Pilot Study Results
References
- Amabile TM:
Creativity in context.
Westview Press;
1996.
- Baer RA:
Mindfulness training as a clinical intervention: A conceptual and empirical review.
Clin. Psychol. Sci. Pract.
2003; 10(2): 125–143. Publisher Full Text
- Biggs J, Tang C:
Teaching for quality learning at university.
McGraw-Hill Education;
4th ed2011.
- Boden MA:
The creative mind: Myths and mechanisms.
Routledge;
2nd ed2004. Publisher Full Text
- Brown KW, Ryan RM:
The benefits of being present: Mindfulness and its role in psychological well-being.
J. Pers. Soc. Psychol.
2003; 84(4): 822–848. Publisher Full Text
- Chen B, deNoyelles A, Patton K, et al.:
Creating a community of inquiry in large-enrollment online courses: An exploratory study on the effect of protocols within online discussions.
Online Learning Journal.
2020; 24(1): 165–188.
- Chin WW:
The partial least squares approach to structural equation modeling.Marcoulides GA, editor.
Modern methods for business research.
Lawrence Erlbaum Associates;
1998; pp. 295–336.
- Cohen J:
Statistical power analysis for the behavioral sciences.
Lawrence Erlbaum Associates;
2nd ed1988.
- Dwivedi YK, Kshetri N, Hughes L, et al.:
“So what if ChatGPT wrote it?” Multidisciplinary perspectives on opportunities, challenges and implications of generative conversational AI for research, practice and policy.
Int. J. Inf. Manag.
2023; 71: 102642. Publisher Full Text
- Field A:
Discovering statistics using IBM SPSS statistics.
SAGE Publications;
5th ed,
2018.
- Fornell C, Larcker DF:
Evaluating structural equation models with unobservable variables and measurement error.
J. Mark. Res.
1981; 18(1): 39–50. Publisher Full Text
- Hair JF, Hult GTM, Ringle CM, et al.:
A primer on partial least squares structural equation modeling (PLS-SEM).
SAGE Publications;
2nd ed2019. Publisher Full Text
- Kasneci E, Sessler K, Küchemann S, et al.:
ChatGPT for good? On opportunities and challenges of large language models for education.
Learn. Individ. Differ.
2023; 103: 102274. Publisher Full Text
- Long D, Magerko B:
What is AI literacy? Competencies and design considerations.
Proceedings of the 2020 CHI Conference on Human Factors in Computing Systems.
Association for Computing Machinery;
2020; pp. 1–16.
- Luckin R, Holmes W, Griffiths M, et al.:
Intelligence unleashed: An argument for AI in education.
Pearson Education;
2016.
- Ng W:
Can we teach digital natives digital literacy?.
Comput. Educ.
2012; 59(3): 1065–1078. Publisher Full Text
- Piaget J:
The psychology of the child.
Basic Books;
1972.
- Stone M:
Cross-validatory choice and assessment of statistical predictions.
J. R. Stat. Soc. Ser. B.
1974; 36(2): 111–133. Publisher Full Text
- Sweller J:
Cognitive load during problem solving: Effects on learning.
Cogn. Sci.
1988; 12(2): 257–285. Publisher Full Text
- Venkatesh V, Morris MG, Davis GB, et al.:
User acceptance of information technology: Toward a unified view.
MIS Q.
2003; 27(3): 425–478. Publisher Full Text
- Vygotsky LS:
Mind in society: The development of higher psychological processes.
Harvard University Press;
1978.
- Waidyarathna TRKMG:
Productive and Unproductive AI Usage in Programming Education: Effects on Learning Behaviour, Creativity, and Performance with the Moderating Role of AI Literacy and Mindfulness.2026a, May 17. Publisher Full Text
- Waidyarathna TRKMG:
Productive and Unproductive AI Usage in Programming Education: Effects on Learning Behaviour, Creativity, and Performance with the Moderating Role of AI Literacy and Mindfulness/Extended.2026b, May 17. Publisher Full Text
- Zawacki-Richter O, Marín VI, Bond M, et al.:
Systematic review of research on artificial intelligence applications in higher education.
Int. J. Educ. Technol. High. Educ.
2019; 16(39): 1–27. Publisher Full Text
- Zimmerman BJ:
Becoming a self-regulated learner: An overview.
Theory Pract.
2002; 41(2): 64–70. Publisher Full Text
Comments on this article Comments (0)