OpenAlex · Aktualisierung stündlich · Letzte Aktualisierung: 04.05.2026, 17:34

Dies ist eine Übersichtsseite mit Metadaten zu dieser wissenschaftlichen Arbeit. Der vollständige Artikel ist beim Verlag verfügbar.

Unlocking Code Simplicity: The Role of Prompt Patterns in Managing LLM Code Complexity

2025·1 Zitationen
Volltext beim Verlag öffnen

1

Zitationen

5

Autoren

2025

Jahr

Abstract

The rapid growth of generative artificial intelligence, especially Large Language Models (LLMs), has greatly influenced software engineering by automating code generation tasks. Despite the potential, challenges in code maintainability and quality persist, mainly due to prompt design. This study examines how various prompt patterns influence the complexity of Python code generated by LLMs, using the Dev-Gpt dataset. Four prompt patterns were analyzed: Zero-Shot, Few-Shot, Chain-Of-Thought, and Personas. Complexity metrics assessed include Lines of Code (LOC), Cyclomatic Complexity, and Halstead metrics, with statistical analyses conducted using the Kruskal-Wallis test and post-hoc pairwise comparisons. Results showed significant differences in LOC and related sub-metrics among these prompt patterns. Notably, the Chain-Of-Thought pattern consistently generated more concise and efficient code, offering strategies to enhance LLM-generated code quality and maintainability.

Ähnliche Arbeiten

Autoren

Institutionen

Themen

Software Engineering ResearchEthics and Social Impacts of AIArtificial Intelligence in Healthcare and Education
Volltext beim Verlag öffnen