Table of Contents
Fetching ...

Method Names in Jupyter Notebooks: An Exploratory Study

Carol Wong, Gunnar Larsen, Rocky Huang, Bonita Sharif, Anthony Peruma

TL;DR

This study investigates how method names are crafted in Jupyter Notebooks, addressing a gap in understanding naming practices within scientific computing. Using a manually annotated dataset of 691 notebook method names from 384 notebooks, the authors analyze case conventions, grammatical patterns, and the use of abbreviations/acronyms, revealing a predominance of snake_case, short two-term names, and a substantial fraction starting with non-verb parts. They identify 68 grammar patterns, note that only about half of return-valued methods start with a verb, and find that abbreviations appear in roughly 30% of names across multiple domains, with markdown and code context aiding expansions. The work highlights implications for extending linguistic antipattern catalogs, building notebook-specific readability models, and developing educational resources to improve scientific code readability and reproducibility in notebooks.

Abstract

Method names play an important role in communicating the purpose and behavior of their functionality. Research has shown that high-quality names significantly improve code comprehension and the overall maintainability of software. However, these studies primarily focus on naming practices in traditional software development. There is limited research on naming patterns in Jupyter Notebooks, a popular environment for scientific computing and data analysis. In this exploratory study, we analyze the naming practices found in 691 methods across 384 Jupyter Notebooks, focusing on three key aspects: naming style conventions, grammatical composition, and the use of abbreviations and acronyms. Our findings reveal distinct characteristics of notebook method names, including a preference for conciseness and deviations from traditional naming patterns. We identified 68 unique grammatical patterns, with only 55.57% of methods beginning with a verb. Further analysis revealed that half of the methods with return statements do not start with a verb. We also found that 30.39% of method names contain abbreviations or acronyms, representing mathematical or statistical terms and image processing concepts, among others. We envision our findings contributing to developing specialized tools and techniques for evaluating and recommending high-quality names in scientific code and creating educational resources tailored to the notebook development community.

Method Names in Jupyter Notebooks: An Exploratory Study

TL;DR

This study investigates how method names are crafted in Jupyter Notebooks, addressing a gap in understanding naming practices within scientific computing. Using a manually annotated dataset of 691 notebook method names from 384 notebooks, the authors analyze case conventions, grammatical patterns, and the use of abbreviations/acronyms, revealing a predominance of snake_case, short two-term names, and a substantial fraction starting with non-verb parts. They identify 68 grammar patterns, note that only about half of return-valued methods start with a verb, and find that abbreviations appear in roughly 30% of names across multiple domains, with markdown and code context aiding expansions. The work highlights implications for extending linguistic antipattern catalogs, building notebook-specific readability models, and developing educational resources to improve scientific code readability and reproducibility in notebooks.

Abstract

Method names play an important role in communicating the purpose and behavior of their functionality. Research has shown that high-quality names significantly improve code comprehension and the overall maintainability of software. However, these studies primarily focus on naming practices in traditional software development. There is limited research on naming patterns in Jupyter Notebooks, a popular environment for scientific computing and data analysis. In this exploratory study, we analyze the naming practices found in 691 methods across 384 Jupyter Notebooks, focusing on three key aspects: naming style conventions, grammatical composition, and the use of abbreviations and acronyms. Our findings reveal distinct characteristics of notebook method names, including a preference for conciseness and deviations from traditional naming patterns. We identified 68 unique grammatical patterns, with only 55.57% of methods beginning with a verb. Further analysis revealed that half of the methods with return statements do not start with a verb. We also found that 30.39% of method names contain abbreviations or acronyms, representing mathematical or statistical terms and image processing concepts, among others. We envision our findings contributing to developing specialized tools and techniques for evaluating and recommending high-quality names in scientific code and creating educational resources tailored to the notebook development community.
Paper Structure (28 sections, 2 tables)