Can Developers Prompt? A Controlled Experiment for Code Documentation Generation

要約

大規模言語モデル(LLM)は、コード・ドキュメントの作成や維持といった退屈な開発作業を自動化する大きな可能性を秘めている。しかし、開発者がLLMに簡潔で有用なドキュメントの作成をどの程度効果的に促すことができるかは不明である。我々は、20人の専門家と30人のコンピュータ・サイエンスの学生を対象に、2つのPython関数のコード・ドキュメンテーション作成をタスクとした対照実験について報告する。実験グループはVisual Studio CodeのChatGPTのような拡張機能でアドホックなプロンプトを自由に入力し、対照グループはあらかじめ定義された数発のプロンプトを実行した。その結果、専門家や学生は、プロンプトエンジニアリングのテクニックを知らなかったり、適用できなかったりすることが明らかになった。特に学生は、アドホックなプロンプトから作成されたドキュメントは、準備されたプロンプトから作成されたドキュメントに比べ、可読性、簡潔性、有用性において著しく劣っていると認識した。プロフェッショナルの中には、アドホックプロンプトにDocstringというキーワードを含めるだけで、より質の高いドキュメントを作成する者もいた。学生は、プロンプトを作成する際に、より多くのサポートを望んでいたが、専門家は、アドホックプロンプトの柔軟性を高く評価していた。両グループの参加者は、アウトプットを完璧だと評価することはほとんどなかった。むしろ、ツールを文書化を繰り返し改良するためのサポートとして理解していた。開発者がどのようなプロンプト作成スキルや嗜好を持ち、特定のタスクに対してどのようなサポートを必要としているかを理解するためには、さらなる研究が必要である。

要約(オリジナル)

Large language models (LLMs) bear great potential for automating tedious development tasks such as creating and maintaining code documentation. However, it is unclear to what extent developers can effectively prompt LLMs to create concise and useful documentation. We report on a controlled experiment with 20 professionals and 30 computer science students tasked with code documentation generation for two Python functions. The experimental group freely entered ad-hoc prompts in a ChatGPT-like extension of Visual Studio Code, while the control group executed a predefined few-shot prompt. Our results reveal that professionals and students were unaware of or unable to apply prompt engineering techniques. Especially students perceived the documentation produced from ad-hoc prompts as significantly less readable, less concise, and less helpful than documentation from prepared prompts. Some professionals produced higher quality documentation by just including the keyword Docstring in their ad-hoc prompts. While students desired more support in formulating prompts, professionals appreciated the flexibility of ad-hoc prompting. Participants in both groups rarely assessed the output as perfect. Instead, they understood the tools as support to iteratively refine the documentation. Further research is needed to understand which prompting skills and preferences developers have and which support they need for certain tasks.

arxiv情報

著者 Hans-Alexander Kruse,Tim Puhlfürß,Walid Maalej
発行日 2024-08-01 16:28:14+00:00
arxivサイト arxiv_id(pdf)

提供元, 利用サービス

arxiv.jp, DeepL

カテゴリー: cs.AI, cs.HC, cs.SE パーマリンク