EUVIMEDEUVIMED entdecken
Crossref

Do Code Summarization Models Process Too Much Information? Function Signature May Be All That Is Needed

Xi Ding, Rui Peng, Xiangping Chen, Yuan Huang, Jing Bian, Zibin Zheng

ACM Transactions on Software Engineering and Methodology · 31.07.2024 · 33 (6) · 1-35

DOI: 10.1145/3652156 ↗

Kurz gefasst

Fachartikel in der Zeitschrift ACM Transactions on Software Engineering and Methodology, online erschienen am 27.06.2024. Verfasst von Xi Ding und 5 weiteren Autor:innen. Die Arbeit wurde bisher 18-mal zitiert (Crossref) und nennt 80 Literaturangaben. Gefördert von: National Key R&D Program of China, National Natural Science Foundation of China, Natural Science Foundation of Guangdong Province.

AbstractBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

With the fast development of large software projects, automatic code summarization techniques, which summarize the main functionalities of a piece of code using natural languages as comments, play essential roles in helping developers understand and maintain large software projects. Many research efforts have been devoted to building automatic code summarization approaches. Typical code summarization approaches are based on deep learning models. They transform the task into a sequence-to-sequence task, which inputs source code and outputs summarizations in natural languages. All code summarization models impose different input size limits, such as 50 to 10,000, for the input source code. However, how the input size limit affects the performance of code summarization models still remains under-explored. In this article, we first conduct an empirical study to investigate the impacts of different input size limits on the quality of generated code comments. To our surprise, experiments on multiple models and datasets reveal that setting a low input size limit, such as 20, does not necessarily reduce the quality of generated comments. Based on this finding, we further propose to use function signatures instead of full source code to summarize the main functionalities first and then input the function signatures into code summarization models. Experiments and statistical results show that inputs with signatures are, on average, more than 2 percentage points better than inputs without signatures and thus demonstrate the effectiveness of involving function signatures in code summarization. We also invite programmers to do a questionnaire to evaluate the quality of code summaries generated by two inputs with different truncation levels. The results show that function signatures generate, on average, 9.2% more high-quality comments than full code.

Förderung

  • National Key R&D Program of China
  • National Natural Science Foundation of China
  • Natural Science Foundation of Guangdong Province

Zitieren

APA

Ding, X., Peng, R., Chen, X., Huang, Y., Bian, J., & Zheng, Z. (2024). Do Code Summarization Models Process Too Much Information? Function Signature May Be All That Is Needed. ACM Transactions on Software Engineering and Methodology, 33(6), 1-35. https://doi.org/10.1145/3652156

Vancouver

Ding X, Peng R, Chen X, Huang Y, Bian J, Zheng Z. Do Code Summarization Models Process Too Much Information? Function Signature May Be All That Is Needed. ACM Transactions on Software Engineering and Methodology. 2024;33(6):1-35. doi:10.1145/3652156

BibTeX
@article{Ding2024,
  author = {Ding, Xi and Peng, Rui and Chen, Xiangping and Huang, Yuan and Bian, Jing and Zheng, Zibin},
  title = {Do Code Summarization Models Process Too Much Information? Function Signature May Be All That Is Needed},
  journal = {ACM Transactions on Software Engineering and Methodology},
  year = {2024},
  volume = {33},
  number = {6},
  pages = {1--35},
  doi = {10.1145/3652156}
}
Kostenlos starten →