Validating AI-Generated Code with Live Programming

Kasra Ferdowsi, Ruanqianqian Huang, Michael B. James, Nadia Polikarpova and Sorin Lerner

Abstract

AI-powered programming assistants are increasingly gaining popularity, with GitHub Copilot alone used by over a million developers worldwide. These tools are far from perfect, however, producing code suggestions that may be incorrect in subtle ways. As a result, developers face a new challenge: validating AI’s suggestions. This paper explores whether Live Programming (LP), a continuous display of a program’s runtime values, can help address this challenge. To answer this question, we built a Python editor that combines an AI-powered programming assistant with an existing LP environment. Using this environment in a between-subjects study (N = 17), we found that by lowering the cost of validation by execution, LP can mitigate over- and under-reliance on AI-generated programs and reduce the cognitive load of validation for certain types of tasks.

Venue
CHI 2024
Volume
Proceedings of the CHI Conference on Human Factors in Computing Systems
DOI
10.1145/3613904.3642495
PDF
https://dl.acm.org/doi/pdf/10.1145/3613904.3642495
Anthology ID
2024.chi.598

Cite

@inproceedings{ferdowsi-etal-2024-validating,
    title = {{Validating AI-Generated Code with Live Programming}},
    author = {Kasra Ferdowsi and Ruanqianqian Huang and Michael B. James and Nadia Polikarpova and Sorin Lerner},
    booktitle = {Proceedings of the CHI Conference on Human Factors in Computing Systems},
    isbn = {9798400703300},
    year = {2024},
    publisher = {Association for Computing Machinery},
    address = {New York, NY, USA},
    doi = {10.1145/3613904.3642495},
    url = {https://doi.org/10.1145/3613904.3642495},
    abstract = {AI-powered programming assistants are increasingly gaining popularity, with GitHub Copilot alone used by over a million developers worldwide. These tools are far from perfect, however, producing code suggestions that may be incorrect in subtle ways. As a result, developers face a new challenge: validating AI’s suggestions. This paper explores whether Live Programming (LP), a continuous display of a program’s runtime values, can help address this challenge. To answer this question, we built a Python editor that combines an AI-powered programming assistant with an existing LP environment. Using this environment in a between-subjects study (N = 17), we found that by lowering the cost of validation by execution, LP can mitigate over- and under-reliance on AI-generated programs and reduce the cognitive load of validation for certain types of tasks.}
}