Measuring the Maintainability of Python Data Analysis Notebooks

Authors

  • Ishaan Sangha Department of Computer Science, University of Alabama at Birmingham, Birmingham, AL, USA. Author
  • Lars-Goran Westman Department of Computer Science, University of Houston, Houston, TX, USA. Author
  • Benedetto Brichese Department of Computer Science, University of Central Florida, Orlando, FL, USA. Author

Keywords:

computational notebooks; software maintainability; Python; static analysis; reproducibility; technical debt

Abstract

Python data analysis notebooks combine executable code, narrative text, rendered outputs, and implicit execution state in a single document. This hybrid form supports exploration, but it also creates maintainability problems that conventional software metrics do not capture. A notebook can appear syntactically simple while depending on out-of-order execution, stale variables, unpinned packages, undocumented data transformations, and prose that no longer matches the code. This paper develops a multidimensional measurement framework for the maintainability of Python data analysis notebooks. The central contribution is an artifact model that treats a notebook as code cells, markdown cells, execution dependencies, external data references, and package requirements, and then derives indicators for code complexity, hidden-state exposure, narrative-code alignment, environment pinning, and data-provenance clarity. These indicators are composed into a maintainability profile and an optional weighted index, with explicit orientation, normalization, and sensitivity rules. The framework is analytical rather than dependent on a single benchmarking dataset: each measure is defined from observable notebook structure and documented assumptions. The paper argues that notebook maintainability should be assessed as a profile rather than reduced to cyclomatic complexity or reproducibility checklists. The resulting measurement model supports tooling, code review, refactoring decisions, and comparative analysis of notebook-based data analysis work while preserving the exploratory advantages that make notebooks useful.

References

1. Kluyver, T., Ragan-Kelley, B., Pérez, F., Granger, B., Bussonnier, M., Frederic, J., ... Jupyter Development Team. (2016). Jupyter Notebooks—a publishing format for reproducible computational workflows. In F. Loizides & B. Schmidt (Eds.), Positioning and power in academic publishing: Players, agents and agendas (pp. 87–90). IOS Press.

2. Pérez, F., & Granger, B. E. (2007). IPython: A system for interactive scientific computing. Computing in Science & Engineering, 9(3), 21–29.

3. Rule, A., Tabard, A., & Hollan, J. D. (2018). Exploration and explanation in computational notebooks. In Proceedings of the 2018 CHI Conference on Human Factors in Computing Systems (Paper 32, pp. 1–12). ACM.

4. Pimentel, J. F., Murta, L., Braganholo, V., & Freire, J. (2019). A large-scale study about quality and reproducibility of Jupyter notebooks. In Proceedings of the 16th International Conference on Mining Software Repositories (pp. 507–517). IEEE.

5. Chattopadhyay, S., Prasad, I., Henley, A. Z., Sarma, A., & Barik, T. (2020). What's wrong with computational notebooks? Pain points, needs, and design opportunities. In Proceedings of the 2020 CHI Conference on Human Factors in Computing Systems (pp. 1–12). ACM.

6. Head, A., Hohman, F., Barik, T., Drucker, S. M., & DeLine, R. (2019). Managing messes in computational notebooks. In Proceedings of the 2019 CHI Conference on Human Factors in Computing Systems (pp. 1–12). ACM.

7. Kery, M. B., & Myers, B. A. (2017). Exploring exploratory programming. In 2017 IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC) (pp. 25–29). IEEE.

8. ISO/IEC. (2011). Systems and software engineering — Systems and software Quality Requirements and Evaluation (SQuaRE) — System and software quality models (ISO/IEC 25010:2011). International Organization for Standardization.

9. Kitchenham, B. A., & Pfleeger, S. L. (1996). Software quality: The elusive target. IEEE Software, 13(1), 12–21.

10. Parnas, D. L. (1994). Software aging. In Proceedings of the 16th International Conference on Software Engineering (pp. 279–287). IEEE.

11. McCabe, T. J. (1976). A complexity measure. IEEE Transactions on Software Engineering, SE-2(4), 308–320.

12. Chidamber, S. R., & Kemerer, C. F. (1994). A metrics suite for object oriented design. IEEE Transactions on Software Engineering, 20(6), 476–493.

13. Basili, V. R., Briand, L. C., & Melo, W. L. (1996). A validation of object-oriented design metrics as quality indicators. IEEE Transactions on Software Engineering, 22(10), 751–761.

14. Fowler, M. (2018). Refactoring: Improving the design of existing code (2nd ed.). Addison-Wesley.

15. Mens, T., & Tourwé, T. (2004). A survey of software refactoring. IEEE Transactions on Software Engineering, 30(2), 126–139.

16. Sandve, G. K., Nekrutenko, A., Taylor, J., & Hovig, E. (2013). Ten simple rules for reproducible computational research. PLOS Computational Biology, 9(10), e1003285.

17. Piccolo, S. R., & Frampton, M. (2016). Tools and techniques for computational reproducibility. GigaScience, 5(1), 30.

18. Boettiger, C. (2015). An introduction to Docker for reproducible research. ACM SIGOPS Operating Systems Review, 49(1), 71–79.

19. Sculley, D., Holt, G., Golovin, D., Davydov, E., Phillips, T., Ebner, D., Chaudhary, V., Young, M., Crespo, J.-F., & Dennison, D. (2015). Hidden technical debt in machine learning systems. In Advances in Neural Information Processing Systems 28 (pp. 2503–2511). Curran Associates.

20. Breck, E., Cai, S., Nielsen, E., Salib, M., & Sculley, D. (2017). The ML test score: A rubric for ML production readiness and technical debt reduction. In 2017 IEEE International Conference on Big Data (Big Data) (pp. 1123–1132). IEEE.

Downloads

Published

2023-05-21