Gistable: Evaluating the Executability of Python Code Snippets on GitHub

Gistable: Evaluating the Executability of Python Code Snippets on GitHub
复制标题

DOI:
10.1109/icsme.2018.00031
复制
发表时间:
2018-08
期刊:
2018 IEEE International Conference on Software Maintenance and Evolution (ICSME)
影响因子:
--
通讯作者:
Eric Horton;Chris Parnin
Eric Horton;Chris Parnin
中科院分区:
其他
文献类型:
--
作者:
Eric Horton;Chris Parnin

文献摘要

相似文献

软件开发人员在线创建和共享代码,以演示编程语言概念和编程任务。代码片段是解释和演示编程概念的一种有用的方式,但可能并不总是直接可执行的。代码片段可能包含解析错误,或者如果环境包含未满足的依赖项,则执行失败。本文对通过GitHub gist系统共享的Python代码片段的可执行状态,以及熟悉软件配置的开发人员正确配置和运行它们的能力进行了实证分析。我们发现75.6%的gist需要重要的配置来克服缺失的依赖项、配置文件、对特定操作系统的依赖,或者其他一些环境配置。我们的研究还表明,开发人员在解决配置错误时对资源名称所做的自然假设的正确性不到一半。我们还介绍了Gistable,这是一个建立在GitHub的gist系统上的数据库和可扩展框架,它提供了可执行的代码片段,以便在软件工程中进行可重复的研究。Gistable包含10259个代码片段,其中大约5000个需要一个Dockerfile来配置和执行,而不会出现导入错误。Gistable可在https://github.com/gistable/gistable公开获取。
Software developers create and share code online to demonstrate programming language concepts and programming tasks. Code snippets can be a useful way to explain and demonstrate a programming concept, but may not always be directly executable. A code snippet can contain parse errors, or fail to execute if the environment contains unmet dependencies. This paper presents an empirical analysis of the executable status of Python code snippets shared through the GitHub gist system, and the ability of developers familiar with software configuration to correctly configure and run them. We find that 75.6% of gists require non-trivial configuration to overcome missing dependencies, configuration files, reliance on a specific operating system, or some other environment configuration. Our study also suggests the natural assumption developers make about resource names when resolving configuration errors is correct less than half the time. We also present Gistable, a database and extensible framework built on GitHub's gist system, which provides executable code snippets to enable reproducible studies in software engineering. Gistable contains 10,259 code snippets, approximately 5,000 with a Dockerfile to configure and execute them without import error. Gistable is publicly available at https://github.com/gistable/gistable.