Skip to main content
QUICK REVIEW

[论文解读] Awareness and Experience of Developers to Outdated and License-Violating Code on Stack Overflow: An Online Survey

Chaiyong Ragkhitwetsagul, Jens Krinke|arXiv (Cornell University)|Jun 21, 2018
Software Engineering Research参考文献 9被引用 9
一句话总结

本研究通过两项在线调查(针对200名回答者和89名访问者)调查了开发者在Stack Overflow上对过时及违反许可证的代码片段的意识与体验。研究发现,19%的回答者很少或从不更新过时代码,98%的回答者在其代码片段中省略许可证,85%的访问者不了解Stack Overflow采用的CC BY-SA 3.0许可证,其中66%未检查许可证冲突——凸显了提升用户对代码复用风险认知的迫切需求。

ABSTRACT

We performed two online surveys of Stack Overflow answerers and visitors to assess their awareness to outdated code and software licenses in Stack Overflow answerers. The answerer survey targeted 607 highly reputed Stack Overflow users and received a high response rate of 33%. Our findings are as follows. Although most of the code snippets in the answers are written from scratch, there are code snippets cloned from the corresponding questions, from personal or company projects, or from open source projects. Stack Overflow answerers are aware that some of their snippets are outdated. However, 19% of the participants report that they rarely or never fix their outdated code. At least 98% of the answerers never include software licenses in their snippets and 69% never check for licensing conflicts with Stack Overflow's CC BY-SA 3.0 if they copy the code from other sources to Stack Overflow answers. The visitor survey uses convenient sampling and received 89 responses. We found that 66% of the participants experienced a problem from cloning and reusing Stack Overflow snippets. Fifty-six percent of the visitors never reported the problems back to the Stack Overflow post. Eighty-five percent of the participants are not aware that StackOverflow applies the CC BY-SA 3.0 license, and sixty-two percent never give attributions to Stack Overflow posts or answers they copied the code from. Moreover, 66% of the participants do not check for licensing conflicts between the copied Stack Overflow code and their software. With these findings, we suggest Stack Overflow raise awareness of their users, both answerers and visitors, to the problem of outdated and license-violating code snippets.

研究动机与目标

  • 评估开发者对Stack Overflow答案中过时及违反许可证代码片段的意识与体验。
  • 调查Stack Overflow答案中代码片段的来源,特别是从外部源复制的情况。
  • 考察开发者在从Stack Overflow复用代码时处理许可证与过时问题的方式。
  • 识别回答者与访问者在引用、许可证检查及问题代码报告方面存在的差距。
  • 提出平台级干预措施,以提升用户对Stack Overflow上代码复用风险的认知。

提出的方法

  • 开展两项在线调查:一项针对607名声誉较高的Stack Overflow回答者,回复率为33%。
  • 采用便利抽样方法进行第二项调查,收集89名Stack Overflow访问者的反馈。
  • 收集有关代码片段来源、对许可证(尤其是CC BY-SA 3.0)的认知,以及更新或引用代码实践的数据。
  • 分析回应以识别代码复用、许可证省略及冲突检查缺失的模式。
  • 比较回答者(内容创建者)与访问者(代码复用者)的发现,以评估系统性风险。

实验结果

研究问题

  • RQ1Stack Overflow回答者在多大程度上意识到自己答案中存在过时代码,以及他们多久更新一次此类代码?
  • RQ2回答者在代码片段中包含软件许可证的频率如何?他们在从外部源复制代码时,检查许可证冲突的频率如何?
  • RQ3Stack Overflow访问者对CC BY-SA 3.0许可证的了解程度如何?在复用代码片段时,有多少比例会给予适当引用?
  • RQ4在从Stack Overflow复用代码后,有多少比例的访问者会遇到错误、过时或许可证冲突等问题?
  • RQ5访问者多久会向原始Stack Overflow帖子报告问题一次?

主要发现

  • 19%的Stack Overflow回答者即使意识到问题,也极少或从不修复其答案中的过时代码片段。
  • 98%的回答者在其代码片段中从不包含软件许可证,即使是从外部源复制的代码。
  • 69%的回答者在将代码从外部源复制到Stack Overflow时,从不检查与原始源的许可证冲突。
  • 85%的访问者不了解Stack Overflow对代码片段应用CC BY-SA 3.0许可证。
  • 62%的访问者在复用代码片段时从不向Stack Overflow帖子提供引用。
  • 66%的访问者在复用Stack Overflow代码与自身软件项目时,不检查许可证冲突。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。