Facebook
TwitterMIT Licensehttps://opensource.org/licenses/MIT
License information was derived automatically
This is the replication package for the paper titled 'Can Developers Prompt? A Controlled Experiment for Code Documentation Generation' that is part of the 40th IEEE International Conference on Software Maintenance and Evolution (ICSME), from October 6 to 11, 2024, located in Flagstaff, AZ, USA.
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.
| Name | Affiliation | |
|---|---|---|
| Hans-Alexander Kruse | Universität Hamburg | mailto:hans-alexander.kruse@studium.uni-hamburg.de" href="mailto:hans-alexander.kruse@studium.uni-hamburg.de">hans-alexander.kruse@studium.uni-hamburg.de |
| Tim Puhlfürß | Universität Hamburg | mailto:tim.puhlfuerss@uni-hamburg.de" href="mailto:tim.puhlfuerss@uni-hamburg.de">tim.puhlfuerss@uni-hamburg.de |
| Walid Maalej | Universität Hamburg | mailto:walid.maalej@uni-hamburg.de" href="mailto:walid.maalej@uni-hamburg.de">walid.maalej@uni-hamburg.de |
@inproceedings{kruse-icsme-2024,
author={Kruse, Hans-Alexander and Puhlf{\"u}r{\ss}, Tim and Maalej, Walid},
booktitle={2022 IEEE International Conference on Software Maintenance and Evolution},
title={Can Developers Prompt? A Controlled Experiment for Code Documentation Generation},
year={2024},
doi={tba},
}
The file kruse-icsme-2024-preprint.pdf is the preprint version of the official paper. You should read the paper in detail to understand the study, especially its methodology and results.
The folder results includes two subfolders, explained in the following.
The subfolder Demographics RQ1 RQ2 provides Jupyter Notebook file evaluation.ipynb for analyzing (1) the experiment participants' submissions of the digital survey and (2) the ad-hoc prompts that the experimental group entered into their tool. Hence, this file provides demographic information about the participants and results for the research questions 1 and 2. Please refer to the README file inside this subfolder for installation steps of the Jupyter Notebook file.
The subfolder RQ2 contains further subfolders with Microsoft Excel files specific to the results of research question 2:
The folder extension contains the code of the Visual Studio Code (VS Code) extension developed in this study to generate code documentation with predefined prompts. Please refer to the README file inside the folder for installation steps. Alternatively, you can install the deployed version of this tool, called Code Docs AI, via the https://marketplace.visualstudio.com/items?itemName=re-devtools.code-docs-ai" href="https://marketplace.visualstudio.com/items?itemName=re-devtools.code-docs-ai">VS Code Marketplace.
You can install the tool to generate code documentation with ad-hoc prompts directly via the https://marketplace.visualstudio.com/items?itemName=zhang-renyang.chat-gpt" href="https://marketplace.visualstudio.com/items?itemName=zhang-renyang.chat-gpt">VS Code Marketplace. We did not include the code of this extension in this replication package due to license conflicts (GNUv3 vs. MIT).
The folder survey contains PDFs of the digital survey in two versions:
The folder appendix provides additional material about the study:
| Version | Changelog |
|---|---|
| 1.0.0 | Initial upload |
| 1.1.0 | Add paper preprint. Update abstract. |
| 1.2.0 | Update replication package based on ICSME Artifact Track reviews |
See LICENSE file.
Not seeing a result you expected?
Learn how you can add new datasets to our index.
Facebook
TwitterMIT Licensehttps://opensource.org/licenses/MIT
License information was derived automatically
This is the replication package for the paper titled 'Can Developers Prompt? A Controlled Experiment for Code Documentation Generation' that is part of the 40th IEEE International Conference on Software Maintenance and Evolution (ICSME), from October 6 to 11, 2024, located in Flagstaff, AZ, USA.
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.
| Name | Affiliation | |
|---|---|---|
| Hans-Alexander Kruse | Universität Hamburg | mailto:hans-alexander.kruse@studium.uni-hamburg.de" href="mailto:hans-alexander.kruse@studium.uni-hamburg.de">hans-alexander.kruse@studium.uni-hamburg.de |
| Tim Puhlfürß | Universität Hamburg | mailto:tim.puhlfuerss@uni-hamburg.de" href="mailto:tim.puhlfuerss@uni-hamburg.de">tim.puhlfuerss@uni-hamburg.de |
| Walid Maalej | Universität Hamburg | mailto:walid.maalej@uni-hamburg.de" href="mailto:walid.maalej@uni-hamburg.de">walid.maalej@uni-hamburg.de |
@inproceedings{kruse-icsme-2024,
author={Kruse, Hans-Alexander and Puhlf{\"u}r{\ss}, Tim and Maalej, Walid},
booktitle={2022 IEEE International Conference on Software Maintenance and Evolution},
title={Can Developers Prompt? A Controlled Experiment for Code Documentation Generation},
year={2024},
doi={tba},
}
The file kruse-icsme-2024-preprint.pdf is the preprint version of the official paper. You should read the paper in detail to understand the study, especially its methodology and results.
The folder results includes two subfolders, explained in the following.
The subfolder Demographics RQ1 RQ2 provides Jupyter Notebook file evaluation.ipynb for analyzing (1) the experiment participants' submissions of the digital survey and (2) the ad-hoc prompts that the experimental group entered into their tool. Hence, this file provides demographic information about the participants and results for the research questions 1 and 2. Please refer to the README file inside this subfolder for installation steps of the Jupyter Notebook file.
The subfolder RQ2 contains further subfolders with Microsoft Excel files specific to the results of research question 2:
The folder extension contains the code of the Visual Studio Code (VS Code) extension developed in this study to generate code documentation with predefined prompts. Please refer to the README file inside the folder for installation steps. Alternatively, you can install the deployed version of this tool, called Code Docs AI, via the https://marketplace.visualstudio.com/items?itemName=re-devtools.code-docs-ai" href="https://marketplace.visualstudio.com/items?itemName=re-devtools.code-docs-ai">VS Code Marketplace.
You can install the tool to generate code documentation with ad-hoc prompts directly via the https://marketplace.visualstudio.com/items?itemName=zhang-renyang.chat-gpt" href="https://marketplace.visualstudio.com/items?itemName=zhang-renyang.chat-gpt">VS Code Marketplace. We did not include the code of this extension in this replication package due to license conflicts (GNUv3 vs. MIT).
The folder survey contains PDFs of the digital survey in two versions:
The folder appendix provides additional material about the study:
| Version | Changelog |
|---|---|
| 1.0.0 | Initial upload |
| 1.1.0 | Add paper preprint. Update abstract. |
| 1.2.0 | Update replication package based on ICSME Artifact Track reviews |
See LICENSE file.