Search papers, labs, and topics across Lattice.
The paper introduces VibeContract, a novel quality assurance paradigm for AI-assisted "vibe coding" where developers use LLMs to generate code from natural language. VibeContract decomposes high-level intent into task sequences and generates task-level contracts specifying expected behaviors, which are then validated by developers and used to guide LLM-based testing and debugging. A demonstration shows that VibeContract significantly improves the correctness, robustness, and maintainability of LLM-generated code by introducing a structured and verifiable workflow.
LLM-generated code, while fast, is often subtly wrong, and VibeContract offers a way to make "vibe coding" more predictable and trustworthy by adding explicit, verifiable contracts.
Recent advances in large language models (LLMs) have given rise to vibe coding, a style of software development where developers rely on AI coding assistants to generate, modify, and refactor code using natural language instructions. While this paradigm accelerates software development and lowers barriers to entry, it introduces new challenges for quality assurance (QA). AI-generated code can appear correct but often contains hidden logical errors and inconsistencies, creating an urgent need for novel QA approaches. In this vision paper, we propose the VibeContract paradigm as a missing piece in vibe coding. In this approach, high-level natural-language intent is decomposed into explicit task sequences, and task-level contracts are generated to capture expected inputs, outputs, constraints, and behavioral properties. Developers validate these contracts, and traceability is maintained between tasks, contracts, and generated code. Contracts then guide LLMs for testing, runtime verification, and debugging, enabling QA to occur continuously and proactively alongside code generation. We demonstrate how the VibeContract paradigm can substantially improve the correctness, robustness, and maintainability of LLM-generated code through an example project. We argue that VibeContract introduces a structured and verifiable development workflow that transforms vibe coding from a fast but error-prone practice into a predictable, auditable, and trustworthy software engineering process. Finally, we outline the key challenges, design principles, and a forward-looking research agenda required to realize this vision.