Exploring Prompt Patterns in AI-Assisted Code Generation: Towards Faster and More Effective Developer-AI Collaboration
By: Sophia DiCuffa , Amanda Zambrana , Priyanshi Yadav and more
Potential Business Impact:
Makes AI write better code with fewer tries.
The growing integration of AI tools in software development, particularly Large Language Models (LLMs) such as ChatGPT, has revolutionized how developers approach coding tasks. However, achieving high-quality code often requires iterative interactions, which can be time-consuming and inefficient. This paper explores the application of structured prompt patterns to minimize the number of interactions required for satisfactory AI-assisted code generation. Using the DevGPT dataset, we analyzed seven distinct prompt patterns to evaluate their effectiveness in reducing back-and-forth communication between developers and AI. Our findings highlight patterns such as ''Context and Instruction'' and ''Recipe'' as particularly effective in achieving high-quality outputs with minimal iterations. The study emphasizes the potential for prompt engineering to streamline developer-AI collaboration, providing practical insights into crafting prompts that balance precision, efficiency, and clarity.
Similar Papers
Do Prompt Patterns Affect Code Quality? A First Empirical Assessment of ChatGPT-Generated Code
Software Engineering
Makes computer code easier to fix and trust.
Prompting in Practice: Investigating Software Developers' Use of Generative AI Tools
Software Engineering
Helps programmers use AI to write better code.
Prompt Programming: A Platform for Dialogue-based Computational Problem Solving with Generative AI Models
Computers and Society
Teaches students to talk to computers for coding help.