Skip to main content
Cornell University
We gratefully acknowledge support from the Simons Foundation, member institutions, and all contributors. Donate
arxiv logo > cs > arXiv:2007.10146

Help | Advanced Search

arXiv logo
Cornell University Logo

quick links

  • Login
  • Help Pages
  • About

Computer Science > Software Engineering

arXiv:2007.10146 (cs)
[Submitted on 20 Jul 2020 (v1), last revised 26 Feb 2021 (this version, v2)]

Title:Jupyter Notebooks on GitHub: Characteristics and Code Clones

Authors:Malin Källén, Tobias Wrigstad
View a PDF of the paper titled Jupyter Notebooks on GitHub: Characteristics and Code Clones, by Malin K\"all\'en and 1 other authors
View PDF
Abstract:Jupyter notebooks has emerged as a standard tool for data science programming. Programs in Jupyter notebooks are different from typical programs as they are constructed by a collection of code snippets interleaved with text and visualisation. This allows interactive exploration and snippets may be executed in different order which may give rise to different results due to side-effects between snippets. Previous studies have shown the presence of considerable code duplication -- code clones -- in sources of traditional programs, in both so-called systems programming languages and so-called scripting languages. In this paper we present the first large-scale study of code cloning in Jupyter notebooks. We analyse a corpus of 2.7 million Jupyter notebooks hosted on GitHJub, representing 37 million individual snippets and 227 million lines of code. We study clones at the level of individual snippets, and study the extent to which snippets are recurring across multiple notebooks. We study both identical clones and approximate clones and conduct a small-scale ocular inspection of the most common clones. We find that code cloning is common in Jupyter notebooks -- more than 70% of all code snippets are exact copies of other snippets (with possible differences in white spaces), and around 50% of all notebooks do not have any unique snippet, but consists solely of snippets that are also found elsewhere. In notebooks written in Python, at least 80% of all snippets are approximate clones and the prevalence of code cloning is higher in Python than in other languages. We further find that clones between different repositories are far more common than clones within the same repository. However, the most common individual repository from which a Jupyter notebook contains clones is the repository in which itself resides.
Subjects: Software Engineering (cs.SE); Programming Languages (cs.PL)
Cite as: arXiv:2007.10146 [cs.SE]
  (or arXiv:2007.10146v2 [cs.SE] for this version)
  https://doi.org/10.48550/arXiv.2007.10146
arXiv-issued DOI via DataCite
Journal reference: The Art, Science, and Engineering of Programming, 2021, Vol. 5, Issue 3, Article 15
Related DOI: https://doi.org/10.22152/programming-journal.org/2021/5/15
DOI(s) linking to related resources

Submission history

From: Malin Källén [view email] [via PROGRAMMINGJOURNAL proxy]
[v1] Mon, 20 Jul 2020 14:19:10 UTC (1,718 KB)
[v2] Fri, 26 Feb 2021 22:38:32 UTC (2,104 KB)
Full-text links:

Access Paper:

    View a PDF of the paper titled Jupyter Notebooks on GitHub: Characteristics and Code Clones, by Malin K\"all\'en and 1 other authors
  • View PDF
  • Other Formats
view license
Current browse context:
cs.PL
< prev   |   next >
new | recent | 2020-07
Change to browse by:
cs
cs.SE

References & Citations

  • NASA ADS
  • Google Scholar
  • Semantic Scholar

DBLP - CS Bibliography

listing | bibtex
Tobias Wrigstad
a export BibTeX citation Loading...

BibTeX formatted citation

×
Data provided by:

Bookmark

BibSonomy logo Reddit logo

Bibliographic and Citation Tools

Bibliographic Explorer (What is the Explorer?)
Connected Papers (What is Connected Papers?)
Litmaps (What is Litmaps?)
scite Smart Citations (What are Smart Citations?)

Code, Data and Media Associated with this Article

alphaXiv (What is alphaXiv?)
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub (What is DagsHub?)
Gotit.pub (What is GotitPub?)
Hugging Face (What is Huggingface?)
Papers with Code (What is Papers with Code?)
ScienceCast (What is ScienceCast?)

Demos

Replicate (What is Replicate?)
Hugging Face Spaces (What is Spaces?)
TXYZ.AI (What is TXYZ.AI?)

Recommenders and Search Tools

Influence Flower (What are Influence Flowers?)
CORE Recommender (What is CORE?)
  • Author
  • Venue
  • Institution
  • Topic

arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.

Which authors of this paper are endorsers? | Disable MathJax (What is MathJax?)
  • About
  • Help
  • contact arXivClick here to contact arXiv Contact
  • subscribe to arXiv mailingsClick here to subscribe Subscribe
  • Copyright
  • Privacy Policy
  • Web Accessibility Assistance
  • arXiv Operational Status
    Get status notifications via email or slack