Saved in:
Bibliographic Details
Main Authors: Fagadau, Ionut Daniel, Mariani, Leonardo, Micucci, Daniela, Riganelli, Oliviero
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2402.08430
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866929243085078528
author Fagadau, Ionut Daniel
Mariani, Leonardo
Micucci, Daniela
Riganelli, Oliviero
author_facet Fagadau, Ionut Daniel
Mariani, Leonardo
Micucci, Daniela
Riganelli, Oliviero
contents Generative AI is changing the way developers interact with software systems, providing services that can produce and deliver new content, crafted to satisfy the actual needs of developers. For instance, developers can ask for new code directly from within their IDEs by writing natural language prompts, and integrated services based on generative AI, such as Copilot, immediately respond to prompts by providing ready-to-use code snippets. Formulating the prompt appropriately, and incorporating the useful information while avoiding any information overload, can be an important factor in obtaining the right piece of code. The task of designing good prompts is known as prompt engineering. In this paper, we systematically investigate the influence of eight prompt features on the style and the content of prompts, on the level of correctness, complexity, size, and similarity to the developers' code of the generated code. We specifically consider the task of using Copilot with 124,800 prompts obtained by systematically combining the eight considered prompt features to generate the implementation of 200 Java methods. Results show how some prompt features, such as the presence of examples and the summary of the purpose of the method, can significantly influence the quality of the result.
format Preprint
id arxiv_https___arxiv_org_abs_2402_08430
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Analyzing Prompt Influence on Automated Method Generation: An Empirical Study with Copilot
Fagadau, Ionut Daniel
Mariani, Leonardo
Micucci, Daniela
Riganelli, Oliviero
Software Engineering
Artificial Intelligence
Generative AI is changing the way developers interact with software systems, providing services that can produce and deliver new content, crafted to satisfy the actual needs of developers. For instance, developers can ask for new code directly from within their IDEs by writing natural language prompts, and integrated services based on generative AI, such as Copilot, immediately respond to prompts by providing ready-to-use code snippets. Formulating the prompt appropriately, and incorporating the useful information while avoiding any information overload, can be an important factor in obtaining the right piece of code. The task of designing good prompts is known as prompt engineering. In this paper, we systematically investigate the influence of eight prompt features on the style and the content of prompts, on the level of correctness, complexity, size, and similarity to the developers' code of the generated code. We specifically consider the task of using Copilot with 124,800 prompts obtained by systematically combining the eight considered prompt features to generate the implementation of 200 Java methods. Results show how some prompt features, such as the presence of examples and the summary of the purpose of the method, can significantly influence the quality of the result.
title Analyzing Prompt Influence on Automated Method Generation: An Empirical Study with Copilot
topic Software Engineering
Artificial Intelligence
url https://arxiv.org/abs/2402.08430