Validating AI-Generated Code with Live Programming
Authors
Title of the Paper
Validating AI-Generated Code with Live Programming
Paper Information
- Field of Study: Human-Computer Interaction, AI-Assisted Programming, Live Programming
- Keywords: Live Programming, AI Assistants, Code Validation, Program Synthesis, User Study
Research Background and Problem
-
Problem or Challenge:
- With the widespread adoption of AI code generation tools (e.g., GitHub Copilot), validating the correctness of AI-generated code has become a new task for developers.
- Studies show that verifying code correctness is a major time bottleneck for programmers using AI programming assistants, potentially leading to over-reliance or lack of trust.
- Current programming environments do not sufficiently support this validation task, especially in terms of reducing validation difficulty and cognitive load.
-
Significance:
- Code validation directly impacts the efficiency of AI generation tools and developers' trust in these tools.
- Over-reliance may introduce errors and security vulnerabilities, while lack of trust may lead to tool abandonment, both of which reduce productivity.
-
Research Motivation and Related Work:
- Existing validation strategies are time-intensive, limiting the effectiveness of AI tools.
- Live programming environments, which visually display real-time values during program execution, may reduce validation costs.
- This study aims to explore whether live programming can address the new demands of AI code validation while complementing existing research on interface design for code generation tools.
Solution
-
Method or Solution:
- Develop a Python programming environment, "Leap," that integrates live programming and AI code generation functionalities, and design an experimental study to investigate the impact of live programming on AI code validation.
- Compare two experimental conditions: with live programming support (LP) and without live programming support (No-LP).
-
Innovations:
- First exploration of live programming applications in AI code validation, particularly its impact on developer behavior and cognitive load by reducing the cost of runtime value validation.
- Implementation of Leap, an experimental tool combining live programming and AI assistants, providing users with instant feedback and continuous code visualization support.
-
Implementation Steps and Key Technologies:
- Develop the Leap tool, integrating AI code assistants and Projection Boxes live programming environment.
- Organize a group experiment with 17 participants, using fixed tasks and open-ended tasks to study validation strategies, cognitive load, and trust in AI suggestions.
- Conduct quantitative and qualitative analyses, including code correctness, validation time, and NASA-TLX cognitive load surveys.
Research Findings
-
Specific Findings:
- Live programming significantly reduced the cost of validating runtime values, making it easier for participants to verify code correctness through execution results.
- The LP group experienced fewer issues with over-reliance or lack of trust, favoring runtime value validation strategies over simple code reading.
- LP significantly reduced cognitive load, especially in tasks involving complex APIs and environments that support validation (e.g., Pandas tasks).
-
Advantages Over Existing Solutions:
- LP minimized workflow interruptions caused by manual debugging with print statements, reducing validation time and cognitive cost.
- Provided continuous visualization support, enabling developers to quickly identify code errors and select better solutions.
- Demonstrated for the first time that LP can assist developers in comparing and selecting among multiple AI suggestions, improving validation efficiency.
-
Experimental or Evaluation Results:
- In fixed tasks, the LP group was more successful in validating the correctness of AI suggestions, with no instances of incomplete validation.
- The LP group reported lower cognitive load, particularly in the dimensions of "effort demand" and "frustration."
- In open-ended tasks, real-time feedback proved highly beneficial for debugging and improving complex tasks.
-
Limitations and Future Directions:
- Current LP support for complex programs and large-scale inputs is limited, requiring stronger tool integration and expansion capabilities.
- Future research could explore deeper integration of AI and LP, such as automatic test case generation, predicting runtime values of interest to users, and assisting with debugging and code repair.
- Further studies could investigate how novice users adapt to live programming and the long-term impact of LP on development efficiency.
Research Questions / Practical Problems
Question signals indexed for this paper.
Research Questions
3- Can live programming reduce developers' cognitive load when verifying correctness of AI-generated code?Category: LLM Trust and Over/Under-RelianceSimilar questionsarrow_forward
- How does live programming affect developers' behavior when selecting and verifying multiple AI code suggestions?Category: LLM Trust and Over/Under-RelianceSimilar questionsarrow_forward
- Can introducing live programming improve trust and efficiency of AI-assisted programming tools?Category: LLM Trust and Over/Under-RelianceSimilar questionsarrow_forward
Practical Problems
1- Developers struggle to quickly verify AI-generated code correctness, leading to low efficiency or tool distrust.Category: LLM Trust and Over/Under-RelianceSimilar questionsarrow_forward
- 100%
Exploring the Design Space of Real-time LLM Knowledge Support Systems: A Case Study of Jargon Explanations
CHI '25· Human-LLM Collaboration +1
- 100%
Less or More: Towards Glanceable Explanations for LLM Recommendations Using Ultra-Small Devices
IUI '25· Human-LLM Collaboration +1
- 100%
NeuroSync: Intent-Aware Code-Based Problem Solving via Direct LLM Understanding Modification
UIST '25· Human-LLM Collaboration +1
- 80%
Ivie: Lightweight Anchored Explanations of Just-Generated Code
CHI '24· Generative AI (Text, Image, Music, Video) +2
- 80%
Interactive Debugging and Steering of Multi-Agent AI Systems
CHI '25· Human-LLM Collaboration +2
- 80%
DIY: Helping People Assess the Correctness of Natural Language to SQL Systems
IUI '21· Human-LLM Collaboration +2
- 80%
Investigating Explainability of Generative Models for Code through Scenario-based Design
IUI '22· Generative AI (Text, Image, Music, Video) +2
- 80%
CoPrompter: User-Centric Evaluation of LM Instruction Alignment for Improved Prompt Engineering
IUI '25· Human-LLM Collaboration +2
- 67%
Planning for Natural Language Failures with the AI Playbook
CHI '21· Human-LLM Collaboration +2
- 67%
Adapting User Interfaces with Model-based Reinforcement Learning
CHI '21· Human-LLM Collaboration +2
Based on Jaccard similarity of research subtopics & professions (≥60%)