Large Language Models (LLMs) are nowadays extensively used for various types of software engineering tasks, primarily code generation. Previous research has shown how suitable prompt engineering could help developers in improving their code generation prompts. However, so far, there do not exist specific guidelines driving developers towards writing suitable prompts for code generation. In this work, we derive and evaluate development-specific prompt optimization guidelines. First, we use an iterative, test-driven approach to automatically refine code generation prompts, and we analyze the outcome of this process to identify prompt improvement items that lead to test passes. We use such elements to elicit 10 guidelines for prompt improvement, related to better specifying I/O, pre-post conditions, providing examples, various types of details, or clarifying ambiguities. We conduct an assessment with 50 practitioners, who report their usage of the elicited prompt improvement patterns, as well as their perceived usefulness, which does not always correspond to the actual usage before knowing our guidelines. Our results lead to implications not only for practitioners and educators, but also for those aimed at creating better LLM-aided software development tools.
Large Language Models in Thematic Analysis: Prompt Engineering, Evaluation, and Guidelines for Qualitative Software Engineering Research
Chalmers University of Technology(查尔姆斯理工大学);University of Gothenburg(哥德堡大学);Universidad Ramon Llull(拉蒙·鲁尔大学);Uppsala University(乌普萨拉大学);University of Hohenheim(霍恩海姆大学)
Guidelines for Empirical Studies in Software Engineering involving Large Language Models
Heidelberg University(海德堡大学);fortiss(福蒂斯研究所);Blekinge Institute of Technology(布莱金厄理工学院);Monash University(莫纳什大学);Technical University of Munich(慕尼黑工业大学);Hasso-Plattner-Institut(哈索·普拉特纳研究所);University of Potsdam(波茨坦大学);University of Bari(巴里大学);University of Victoria(维多利亚大学);University of Rome Tor Vergata(罗马第二大学);Lero(莱罗研究中心);University of Limerick(利默里克大学);Singapore Management University(新加坡管理大学);PUC Rio de Janeiro(里约热内卢天主教大学);Aalborg University in Copenhagen(哥本哈根奥尔堡大学);IT University of Copenhagen(哥本哈根信息技术大学);Chalmers University of Technology(查尔姆斯理工大学);University of Gothenburg(哥德堡大学)
Predicting LLM Performance from Prompt Linguistic Features: An Empirical Study in Requirements Engineering
Universitat Politècnica de Catalunya(加泰罗尼亚理工大学);Istituto di Linguistica Computazionale “A. Zampolli” (CNR-ILC)(“A.赞波利”计算语言学研究所(意大利国家研究委员会));University of Padua(帕多瓦大学);University College Dublin(都柏林大学学院)
Jailbreaking ChatGPT via Prompt Engineering: An Empirical Study
Nanyang Technological University(南洋理工大学);University of New South Wales(新南威尔士大学);Virginia Tech(弗吉尼亚理工大学);Huazhong University of Science and Technology(华中科技大学)
Prompt Engineering Strategies for LLM-based Qualitative Coding of Psychological Safety in Software Engineering Communities: A Controlled Empirical Study
Federal University of Bahia(巴伊亚联邦大学);State University of Feira de Santana(费拉德桑塔纳州立大学);Federal University of Sergipe(塞格皮联邦大学);Federal Institute of Ceara(塞阿拉联邦理工学院)