Interactive Code Generation via Test-Driven User-Intent Formalization
Shuvendu K. Lahiri, Sarah Fakhoury, Aaditya Naik, Georgios, Sakkas, Saikat Chakraborty, Madanlal Musuvathi, Piali Choudhury and, Curtis von Veh, Jeevana Priya Inala, Chenglong Wang, Jianfeng Gao

TL;DR
This paper introduces an interactive, test-driven approach to code generation that incorporates user feedback to formalize intent, improve suggestions, and enhance accuracy in code produced by large language models.
Contribution
It presents a novel workflow and algorithm for interactive code generation that uses user feedback to formalize intent and refine code suggestions, with a concrete implementation called TiCoder.
Findings
Improved code accuracy by up to 37.71% on MBPP benchmark.
Enhanced code correctness with 24.79% to 53.98% improvements on HumanEval.
Effective use of simulated user queries to refine code suggestions.
Abstract
Large language models (LLMs) have shown great potential in automating significant aspects of coding by producing natural code from informal natural language (NL) intent. However, when interacting with LLMs, users have no guarantees that the code suggestions produced correctly satisfy the intent they provided. In fact, it is hard to define a notion of correctness since natural language can be ambiguous and lacks a formal semantics. In this paper, we propose the workflow of {\it interactive test-driven code generation}, which leverages lightweight user feedback to (a) formalize the user intent using generated tests that can be useful for debugging, and (b) produce an improved set of code suggestions by pruning and ranking candidate code suggestions. We describe a language-agnostic abstract algorithm and a concrete implementation TiCoder. We perform an automated evaluation of TiCoder on…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software Testing and Debugging Techniques · Topic Modeling
MethodsTest
