paper-with-me

홈 › Papers

Do Prompt Patterns Affect Code Quality? A First Empirical Assessment of ChatGPT-Generated Code

2025-04-18 · Antonio Della Porta, Stefano Lambiase, Fabio Palomba

Large Language Models (LLMs) have rapidly transformed software development, especially in code generation. However, their inconsistent performance, prone to hallucinations and quality issues, complicates program comprehension and hinders maintainability. Research indicates that prompt engineering-the practice of designing inputs to direct LLMs toward generating relevant outputs-may help address these challenges. In this regard, researchers have introduced prompt patterns, structured templates intended to guide users in formulating their requests. However, the influence of prompt patterns on code quality has yet to be thoroughly investigated. An improved understanding of this relationship would be essential to advancing our collective knowledge on how to effectively use LLMs for code generation, thereby enhancing their understandability in contemporary software development. This paper empirically investigates the impact of prompt patterns on code quality, specifically maintainability, security, and reliability, using the Dev-GPT dataset. Results show that Zero-Shot prompting is most common, followed by Zero-Shot with Chain-of-Thought and Few-Shot. Analysis of 7583 code files across quality metrics revealed minimal issues, with Kruskal-Wallis tests indicating no significant differences among patterns, suggesting that prompt structure may not substantially impact these quality metrics in ChatGPT-assisted code generation.

📄 PDF Abstract BibTeX arXiv:2504.13656

Code (0)

등록된 구현이 없습니다.

Tasks

Code GenerationPrompt Engineering

Similar Papers 제목 키워드 기반

ChatGPT Prompt Patterns for Improving Code Quality, Refactoring, Requirements Elicitation, and Software Design

2023-03-11 · Jules White, Sam Hays, Quchen Fu, Jesse Spencer-Smith 외

This paper presents prompt design techniques for software engineering, in the form of patterns, to solve common problems when using large language models (LLMs), such as ChatGPT to automate common software engineering ac…

The Readability Spectrum: Patterns, Issues, and Prompt Effects in LLM-Generated Code

2026-05-13 · Hengzhi Ye, Fengyuan Ran, Weiwei Xu, Minghui Zhou arxiv

As Large Language Models (LLMs) are transforming software development, the functional quality of generated code has become a central focus, leaving readability, one of critical non-functional attributes, understudied. Gi…

Prompt Engineering

Is Your Prompt Poisoning Code? Defect Induction Rates and Security Mitigation Strategies

2025-10-27 · Bin Wang, YiLu Zhong, MiDi Wan, WenJie Yu 외 arxiv

Large language models (LLMs) have become indispensable for automated code generation, yet the quality and security of their outputs remain a critical concern. Existing studies predominantly concentrate on adversarial att…

Code Generation

Beyond Single Prompts: Synergistic Fusion and Arrangement for VICL

2026-01-15 · Wenwen Liao, Jianbo Yu, Yuansong Wang, Shifu Yan 외 arxiv

Vision In-Context Learning (VICL) enables inpainting models to quickly adapt to new visual tasks from only a few prompts. However, existing methods suffer from two key issues: (1) selecting only the most similar prompt d…

Image ColorizationObject Detection

Large Language Models for Code Generation from Multilingual Prompts: A Curated Benchmark and a Study on Code Quality

2026-07-16 · Saima Afrin, Alessandro Midolo, Camilo Escobar-Velásquez, Mario Linares-Vásquez 외 arxiv

Large Language Models (LLMs) perform differently on identical programming tasks when prompted in different natural languages, a phenomenon known as language bias. While this behavior has been widely studied for general t…

Code GenerationText Generation