Code Duplication and Reuse in Jupyter Notebooks
Andreas Koenzen, Neil Ernst, Margaret-Anne Storey

TL;DR
This study investigates code duplication and reuse in Jupyter notebooks, revealing that while self-duplication is modest, users prefer reusing external code sources, impacting how notebooks are developed and maintained.
Contribution
The paper provides the first quantitative analysis of code duplication in notebooks and explores user preferences and barriers in code reuse.
Findings
Repositories have a 7.6% self-duplication rate.
Users prefer reusing external code over self-duplication.
Barriers to code reuse include accessibility and context mismatch.
Abstract
Duplicating one's own code makes it faster to write software. This expediency is particularly valuable for users of computational notebooks. Duplication allows notebook users to quickly test hypotheses and iterate over data. In this paper, we explore how much, how and from where code duplication occurs in computational notebooks, and identify potential barriers to code reuse. Previous work in the area of computational notebooks describes developers' motivations for reuse and duplication but does not show how much reuse occurs or which barriers they face when reusing code. To address this gap, we first analyzed GitHub repositories for code duplicates contained in a repository's Jupyter notebooks, and then conducted an observational user study of code reuse, where participants solved specific tasks using notebooks. Our findings reveal that repositories in our sample have a mean…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
