arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2504.16485cs.SEcs.AI
收藏

关于开发者对AI生成代码的自我声明:实践分析

On Developers' Self-Declaration of AI-Generated Code: An Analysis of Practices

School of Computer Science, Wuhan University(武汉大学计算机科学学院);School of Mathematical and Computational Sciences, Massey University(马斯赛大学数学与计算科学学院)

Syed Mohammad Kashif, Peng Liang, Amjed Tahir

AI总结:

本研究通过混合方法调查开发者自我声明AI生成代码的实践,发现76.6%的开发者常声明,主要出于追踪和伦理考虑,并提供了相关指南。

摘要:

AI代码生成工具在开发者中获得了显著的普及,开发者利用这些工具辅助软件开发,因为它们具有生成代码的能力。现有研究主要探讨了AI生成代码的质量,例如正确性和安全性,而在实际软件开发中,前提是要区分AI生成的代码与人类编写的代码,这强调了开发者明确声明AI生成代码的必要性。为此,本研究旨在理解开发者自我声明AI生成代码所采用的方式,并探讨开发者选择自我声明或不自我声明的原因。我们进行了一项包含两个阶段的混合方法研究。在第一阶段,我们挖掘了GitHub仓库,收集了613个AI生成代码片段的实例。在第二阶段,我们进行了一项后续的从业者调查,收到了111份有效回复。我们的研究揭示了开发者自我声明AI生成代码所遵循的实践。大多数从业者(76.6%)总是或有时自我声明AI生成代码。相比之下,其他从业者(23.4%)表示他们从不自我声明AI生成代码。自我声明AI生成代码的原因包括需要跟踪和监控代码以供未来审查和调试,以及伦理考量。不自我声明AI生成代码的原因包括对AI生成代码的大量修改以及开发者认为自我声明是一项不必要的活动。我们最终为从业者提供了自我声明AI生成代码的指南,以解决伦理和代码质量问题。

英文摘要:

AI code generation tools have gained significant popularity among developers, who use them to assist in software development due to their capability to generate code. Existing studies mainly explored the quality, e.g., correctness and security, of AI-generated code, while in real-world software development, the prerequisite is to distinguish AI-generated code from human-written code, which emphasizes the need to explicitly declare AI-generated code by developers. To this end, this study intends to understand the ways developers use to self-declare AI-generated code and explore the reasons why developers choose to self-declare or not. We conducted a mixed-methods study consisting of two phases. In the first phase, we mined GitHub repositories and collected 613 instances of AI-generated code snippets. In the second phase, we conducted a follow-up practitioners' survey, which received 111 valid responses. Our research revealed the practices followed by developers to self-declare AI-generated code. Most practitioners (76.6%) always or sometimes self-declare AI-generated code. In contrast, other practitioners (23.4%) noted that they never self-declare AI-generated code. The reasons for self-declaring AI-generated code include the need to track and monitor the code for future review and debugging, and ethical considerations. The reasons for not self-declaring AI-generated code include extensive modifications to AI-generated code and the developers' perception that self-declaration is an unnecessary activity. We finally provided guidelines for practitioners to self-declare AI-generated code, addressing ethical and code quality concerns.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑