[论文解读] Which is a better programming assistant? A comparative study between chatgpt and stack overflow
本研究通过一项包含44名学生的受控用户实验,比较了ChatGPT与Stack Overflow在编程辅助方面的表现,任务类型涵盖算法、库函数使用及调试。在算法和库函数使用任务中,ChatGPT在代码质量方面优于Stack Overflow,且在算法挑战中速度更快;而在调试任务中,Stack Overflow表现更优,因其提供的解决方案经社区验证且错误解释更详细。
Programmers often seek help from Q\&A websites to resolve issues they encounter during programming. Stack Overflow has been a widely used platform for this purpose for over a decade. Recently, revolutionary AI-powered platforms like ChatGPT have quickly gained popularity among programmers for their efficient and personalized programming assistance via natural language interactions. Both platforms can offer valuable assistance to programmers, but it's unclear which is more effective at enhancing programmer productivity. In our paper, we conducted an exploratory user study to compare the performance of Stack Overflow and ChatGPT in enhancing programmer productivity. Two groups of students with similar programming abilities were instructed to use the two platforms to solve three different types of programming tasks: algorithmic challenges, library usage, and debugging. During the experiments, we measured and compared the quality of code produced and the time taken to complete tasks for the two groups. The results show that, concerning code quality, ChatGPT outperforms Stack Overflow significantly in helping complete algorithmic and library-related tasks, while Stack Overflow is better for debugging tasks. Regarding task completion speed, the ChatGPT group is obviously faster than the Stack Overflow group in the algorithmic challenge, but the two groups have a similar performance in the other two tasks. Additionally, we conducted a post-experiment survey with the participants to understand how the platforms have helped them complete the programming tasks. We analyzed the questionnaires to summarize ChatGPT and Stack Overflow's strengths and weaknesses pointed out by the participants. By comparing these, we identified the reasons behind the two platforms' divergent performances in programming assistance.
研究动机与目标
- 探究在提升程序员生产力方面,ChatGPT与Stack Overflow哪个平台更有效。
- 比较两种平台在不同编程任务中对代码质量和任务完成速度的影响。
- 基于用户经验和性能指标,识别每种平台的优势与劣势。
- 通过实验后的用户反馈,理解不同任务类型下性能差异的潜在原因。
提出的方法
- 开展一项受控用户研究,参与者共44人,编程能力相近,分为两组:一组使用ChatGPT,另一组使用Stack Overflow。
- 分配三种不同类型的任务:算法挑战、库函数使用和调试任务,所有任务均在标准化的软硬件环境中进行。
- 通过客观评估标准衡量代码质量,并记录任务完成时间以评估生产力。
- 通过屏幕录制记录参与者操作,以确保交互过程的一致性与可追溯性。
- 实验后发放问卷,收集用户对平台优缺点的定性反馈。
- 分析问卷反馈,提取常见主题,并与定量性能结果进行关联。
实验结果
研究问题
- RQ1RQ1:在提升程序员代码质量方面,哪个平台表现更优?
- RQ2RQ2:在提升程序员任务完成速度方面,哪个平台表现更优?
- RQ3RQ3:ChatGPT与Stack Overflow在不同任务类型中表现差异的潜在原因是什么?
主要发现
- 在算法和与库相关的任务中,ChatGPT生成的代码质量显著高于Stack Overflow,该结果基于客观的代码评估标准。
- 在算法挑战中,ChatGPT组的平均任务完成时间比Stack Overflow组快30%,表明在该类别中速度表现更优。
- 在调试任务中,Stack Overflow在代码质量方面优于ChatGPT,可能是因为其提供了详细且经社区验证的解释以及真实世界中的错误模式。
- 在库函数使用和调试任务中,两者的任务完成时间相近,表明在这些领域双方均无显著速度优势。
- 参与者反馈指出,ChatGPT对新问题或抽象问题的响应更及时且上下文相关,而Stack Overflow则为边界情况提供了更可靠、经验证的解决方案。
- 实验后问卷显示,用户更信任Stack Overflow处理复杂调试问题,因其社区答案具有透明性和可验证性;而ChatGPT则更受青睐于快速原型设计和学习新库。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。