Software engineering research has always being concerned with the improvement of code completion approaches, which suggest the next tokens a developer will likely type while coding. The release of GitHub Copilot constitutes a big step forward, also because of its unprecedented ability to automatically generate even entire functions from their natural language description. While the usefulness of Copilot is evident, it is still unclear to what extent it is robust. Specifically, we do not know the extent to which semantic-preserving changes in the natural language description provided to the model have an effect on the generated code function. In this paper we present an empirical study in which we aim at understanding whether different but semantically equivalent natural language descriptions result in the same recommended function. A negative answer would pose questions on the robustness of deep learning (DL)-based code generators since it would imply that developers using different wordings to describe the same code would obtain different recommendations. We asked Copilot to automatically generate 892 Java methods starting from their original Javadoc description. Then, we generated different semantically equivalent descriptions for each method both manually and automatically, and we analyzed the extent to which predictions generated by Copilot changed. Our results show that modifying the description results in different code recommendations in ~46% of cases. Also, differences in the semantically equivalent descriptions might impact the correctness of the generated code ~28%.
Understanding the Impact of AI Code Assistants on Security API Usage: An Empirical Study
Centre for Research on Engineering Software Technologies (CREST) & Adelaide University, Australia(工程软件研究技术中心(CREST)及阿德莱德大学,澳大利亚);Edith Cowan University, Australia(埃德温·考文大学,澳大利亚);CSIRO’s Data61, Australia(CSIRO数据61,澳大利亚)
Not as Sweet by Another Name: An Empirical Study of Format Robustness in LLM Document Workflows
Nanyang Technological University(南洋理工大学);National University of Singapore(新加坡国立大学);Beihang University(北京航空航天大学);Xi’an University of Architecture and Technology(西安建筑科技大学)
Learn to Code Sustainably: An Empirical Study on LLM-based Green Code Generation
TWT GmbH Science & Innovation(TWT 科学与创新有限公司);National Technical University of Athens(雅典国立技术大学);Massachusetts Institute of Technology(麻省理工学院);Harvard University(哈佛大学);Mercedes-Benz(梅赛德斯-奔驰)