首页> 外文期刊>Empirical Software Engineering >How do developers utilize source code from stack overflow?
【24h】

How do developers utilize source code from stack overflow?

机译:开发人员如何利用堆栈溢出的源代码?

获取原文
获取原文并翻译 | 示例

摘要

Technical question and answer Q&A platforms, such as Stack Overflow, provide a platform for users to ask and answer questions about a wide variety of programming topics. These platforms accumulate a large amount of knowledge, including hundreds of thousands lines of source code. Developers can benefit from the source code that is attached to the questions and answers on Q&A platforms by copying or learning from (parts of) it. By understanding how developers utilize source code from Q&A platforms, we can provide insights for researchers which can be used to improve next-generation Q&A platforms to help developers reuse source code fast and easily. In this paper, we first conduct an exploratory study on 289 files from 182 open-source projects, which contain source code that has an explicit reference to a Stack Overflow post. Our goal is to understand how developers utilize code from Q&A platforms and to reveal barriers that may make code reuse more difficult. In 31.5% of the studied files, developers needed to modify source code from Stack Overflow to make it work in their own projects. The degree of required modification varied from simply renaming variables to rewriting the whole algorithm. Developers sometimes chose to implement an algorithm from scratch based on the descriptions from Stack Overflow answers, even if there was an implementation readily available in the post. In 35.5% of the studied files, developers used Stack Overflow posts as an information source for later reference. To further understand the barriers of reusing code and to obtain suggestions for improving the code reuse process on Q&A platforms, we conducted a survey with 453 open-source developers who are also on Stack Overflow. We found that the top 3 barriers that make it difficult for developers to reuse code from Stack Overflow are: (1) too much code modification required to fit in their projects, (2) incomprehensive code, and (3) low code quality. We summarized and analyzed all survey responses and we identified that developers suggest improvements for future Q&A platforms along the following dimensions: code quality, information enhancement & management, data organization, license, and the human factor. For instance, developers suggest to improve the code quality by adding an integrated validator that can test source code online, and an outdated code detection mechanism. Our findings can be used as a roadmap for researchers and developers to improve code reuse.
机译:技术问答平台(如Stack Overflow)为用户提供了一个平台,可以就各种编程主题提出和回答问题。这些平台积累了大量知识,包括数十万行源代码。开发人员可以通过复制(或部分学习)问答中附带的源代码,从中受益。通过了解开发人员如何利用Q&A平台的源代码,我们可以为研究人员提供见解,可用于改进下一代Q&A平台,以帮助开发人员快速轻松地重用源代码。在本文中,我们首先对182个开源项目中的289个文件进行了探索性研究,这些文件包含的源代码明确引用了Stack Overflow帖子。我们的目标是了解开发人员如何利用问答平台提供的代码,并发现可能使代码重用更加困难的障碍。在研究的31.5%的文件中,开发人员需要修改Stack Overflow的源代码以使其在自己的项目中运行。从简单重命名变量到重写整个算法,所需的修改程度有所不同。开发人员有时会根据Stack Overflow答案的描述选择从头开始实现算法,即使帖子中有可用的实现也是如此。在研究的35.5%的文件中,开发人员使用Stack Overflow帖子作为信息源,以供日后参考。为了进一步了解重用代码的障碍,并获得改进Q&A平台上的代码重用过程的建议,我们对453名同样使用Stack Overflow的开源开发人员进行了调查。我们发现,使开发人员难以重用Stack Overflow的代码的前3个障碍是:(1)需要太多的代码修改才能适合其项目;(2)不全面的代码;(3)代码质量低下。我们总结并分析了所有调查答复,并确定开发人员在以下方面对未来的问答平台提出了改进建议:代码质量,信息增强和管理,数据组织,许可证和人为因素。例如,开发人员建议通过添加可以在线测试源代码的集成验证器和过时的代码检测机制来提高代码质量。我们的发现可以用作研究人员和开发人员改善代码重用的路线图。

著录项

  • 来源
    《Empirical Software Engineering》 |2019年第2期|637-673|共37页
  • 作者单位

    Osaka Univ, Grad Sch Informat Sci & Technol, Suita, Osaka, Japan;

    Queens Univ, SAIL, Kingston, ON, Canada;

    Queens Univ, SAIL, Kingston, ON, Canada;

    Osaka Univ, Grad Sch Informat Sci & Technol, Suita, Osaka, Japan;

  • 收录信息
  • 原文格式 PDF
  • 正文语种 eng
  • 中图分类
  • 关键词

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号