一句话:通过用户研究评估 GitHub Copilot 对代码安全性的影响,发现其有助于解决较难问题时的安全表现。
AI 代码生成工具日益普及,但已有研究表明其可能生成不安全代码。本文对 GitHub Copilot 进行以用户为中心的安全性评估,邀请 25 名参与者解决具有潜在漏洞的编程问题,并比较有无 Copilot 辅助时的解决方案安全性。结果显示:在较难问题上,使用 Copilot 的参与者更可能给出更安全的解决方案;在较容易问题上,Copilot 对安全性没有显著影响;同时未发现 Copilot 对特定漏洞类型产生不成比例的影响。作者认为 Copilot 可能带来安全收益,但仍需进一步研究代码生成工具在技术复杂且具有安全需求问题上的影响。
Code generation tools driven by artificial intelligence have recently become more popular due to advancements in deep learning and natural language processing that have increased their capabilities. The proliferation of these tools may be a double-edged sword because while they can increase developer productivity by making it easier to write code, research has shown that they can also generate insecure code. In this paper, we perform a user-centered evaluation GitHub's Copilot to better understand its strengths and weaknesses with respect to code security. We conduct a user study where participants solve programming problems (with and without Copilot assistance) that have potentially vulnerable solutions. The main goal of the user study is to determine how the use of Copilot affects participants' security performance. In our set of participants (n=25), we find that access to Copilot accompanies a more secure solution when tackling harder problems. For the easier problem, we observe no effect of Copilot access on the security of solutions. We also observe no disproportionate impact of Copilot use on particular kinds of vulnerabilities. Our results indicate that there are potential security benefits to using Copilot, but more research is warranted on the effects of the use of code generation tools on technically complex problems with security requirements.