Executability of Python Snippets in Stack Overflow

07/10/2019
by   Md Monir Hossain, et al.
0

Online resources today contain an abundant amount of code snippets for documentation, collaboration, learning, and problem-solving purposes. Their executability in a "plug and play" manner enables us to confirm their quality and use them directly in projects. But, in practice that is often not the case due to several requirements violations or incompleteness. However, it is a difficult task to investigate the executability on a large scale due to different possible errors during the execution. We have developed a scalable framework to investigate this for SOTorrent Python snippets. We found that with minor adjustments, 27.92 changed significantly over time. The code snippets referenced in GitHub are more likely to be directly executable. But executability does not affect the chances of the answer to be selected as the accepted answer significantly. These properties help us understand and improve the interaction of users with online resources that include code snippets.

READ FULL TEXT
research
07/12/2022

Making Python Code Idiomatic by Automatic Refactoring Non-Idiomatic Python Code with Pythonic Idioms

Compared to other programming languages (e.g., Java), Python has more id...
research
10/04/2021

PyTorrent: A Python Library Corpus for Large-scale Language Models

A large scale collection of both semantic and natural language resources...
research
03/30/2022

pycefr: Python Competency Level through Code Analysis

Python is known to be a versatile language, well suited both for beginne...
research
05/27/2019

DockerizeMe: Automatic Inference of Environment Dependencies for Python Code Snippets

Platforms like Stack Overflow and GitHub's gist system promote the shari...
research
08/06/2020

Gathering GitHub OSS Requirements from Q A Community: an Empirical Study

Cross-community collaboration can exploit the expertise and knowledges o...
research
01/30/2023

Faster or Slower? Performance Mystery of Python Idioms Unveiled with Empirical Evidence

The usage of Python idioms is popular among Python developers in a forma...
research
03/17/2023

Prevalence of Code Smells in Reinforcement Learning Projects

Reinforcement Learning (RL) is being increasingly used to learn and adap...

Please sign up or login with your details

Forgot password? Click here to reset