Code Cloning Habits Of The Jupyter Notebook Community

Code reuse has the benefits of saving time and resources but poses a risk whenattempting to tailor copied code for a new purpose or in cases when such copies arebuggy or otherwise faulty. In the field of data science, the web application JupyterNotebook is a popular tool for creating computational n...

Full description

Bibliographic Details
Main Author: Sigvardsson, Ulf
Format: Others
Language:English
Published: Uppsala universitet, Institutionen för informationsteknologi 2019
Subjects:
Online Access:http://urn.kb.se/resolve?urn=urn:nbn:se:uu:diva-396822
Description
Summary:Code reuse has the benefits of saving time and resources but poses a risk whenattempting to tailor copied code for a new purpose or in cases when such copies arebuggy or otherwise faulty. In the field of data science, the web application JupyterNotebook is a popular tool for creating computational notebooks, documentscontaining both plain text and code snippets, many of which are publicly available oncode hosting sites such as GitHub. This thesis describes the acquisition ofapproximately 2.6 million computational notebooks and analysis of this data set.By hashing the contents of every code snippet, using the MD5 hashing algorithm,cloned snippets were found through snippets producing identical hashes. Bysubsequently mapping the snippets to their corresponding notebooks, the relativeoriginality of a notebook could be determined. This analysis shows that nearly 95% ofnotebooks are written in some version of Python. Furthermore, nearly 54% ofnotebooks in the data set are comprised of code blocks also found in othernotebooks and, on average, approximately 70% of the code in any given notebookis copied from elsewhere.