← Latest papers
💻 computer science

A Study of Scientific Computational Notebook Quality

This study evaluates the quality of scientific code from 2024 Nature publications, revealing critical challenges in reproducibility, readability, and reusability—such as low execution success rates, widespread code duplication, and tangled state management—that hinder scientific progress and underscore the need for improved tools and abstractions.

Original authors: Shun Kashiwa, Ayla Kurdak, Savitha Ravi, Ridhi Srikanth, Angel Thakur, Sonia Chandra, Jonathan Truong, Michael Coblenz

Published 2026-03-25
📖 5 min read🧠 Deep dive

Original authors: Shun Kashiwa, Ayla Kurdak, Savitha Ravi, Ridhi Srikanth, Angel Thakur, Sonia Chandra, Jonathan Truong, Michael Coblenz

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you are a chef who has just published a groundbreaking recipe for a new dish in a famous cookbook. You want other chefs to be able to cook your dish exactly the same way so they can taste the magic and build upon your creation.

In the world of science, the "recipe" is the computer code (specifically, a Jupyter Notebook). These notebooks are like digital lab notebooks where scientists mix their code (the instructions) with text (the story of what they did) and charts (the results).

This paper is essentially a health inspection of 518 of these scientific "recipes" taken from the prestigious Nature journal. The researchers wanted to see if these recipes were actually usable by other chefs. They looked at three main things:

  1. Reproducibility: Can someone else actually cook the dish?
  2. Readability: Can someone else understand the instructions?
  3. Reusability: Can someone else tweak the recipe to make a new dish?

Here is what they found, explained with some kitchen metaphors:

1. The "Missing Ingredients" Disaster (Reproducibility)

The researchers tried to run 19 of these scientific notebooks. The result? Only 2 worked perfectly.

  • The Analogy: Imagine you buy a recipe book, but when you try to cook the first dish, you realize the recipe says "add 1 cup of [Mystery Powder]" but the jar is empty. Or, the recipe says "use a specific type of stove," but you don't have one.
  • The Reality: In 11 out of the 19 failed attempts, the code was trying to use data files (the ingredients) that simply weren't in the folder. The scientists had forgotten to pack the ingredients in the box they mailed to the world. In other cases, the "stove" (software libraries) was the wrong version, causing the whole thing to explode.

2. The "Copy-Paste" Chaos (Readability & Clones)

The researchers looked for Code Clones. This is when a scientist copies a chunk of code and pastes it somewhere else instead of writing a reusable function.

  • The Analogy: Imagine a chef who writes a paragraph about "how to chop onions" on page 1. Then, on page 5, instead of saying "see page 1," they copy-paste that exact same paragraph again. Then on page 12, they do it a third time.
  • The Problem: If the chef decides to change how they chop onions (maybe they want to dice them instead of slice them), they have to remember to change it in three different places. If they miss one, the dish tastes weird.
  • The Finding: They found hundreds of these copy-paste instances. Scientists often copy-paste because it's faster in the moment, but it creates a "spaghetti code" mess that is hard to read and even harder to fix later.

3. The "Tangled State" Trap (Mutation)

This is the most technical part, but here is the simple version. In a normal computer program, you usually do things in a straight line: Step A, then Step B, then Step C.

In Jupyter Notebooks, scientists can run cells (steps) in any order they want. They can run Step C before Step A.

  • The Analogy: Imagine you are baking a cake.
    • Normal Code: You mix the batter, then you bake it, then you frost it.
    • Scientific Notebook: You put the cake in the oven. Then you realize you forgot the eggs, so you go back and add eggs to the batter while it's baking. Then you take it out, add frosting, then realize you need to add more sugar, so you put it back in the oven.
  • The Problem: The "state" of the cake (is it raw? is it baked? is it frosted?) is tangled. If you try to read the recipe later, you have no idea what the cake looks like at any given moment because the steps happened in a random order. This makes it incredibly hard to understand what the code is actually doing.

The Big Picture: Why This Matters

The authors found that while scientists are great at doing science, they often lack the "software engineering" skills to package their work nicely.

  • The Good News: Scientists want to share their work (that's why they publish in Nature).
  • The Bad News: The tools they use (Jupyter Notebooks) are too flexible. They let you do anything, which is great for exploring ideas, but terrible for making sure the final result is clean and reproducible.

What Should We Do?

The paper suggests we need better tools. Imagine a "Smart Kitchen" that:

  1. Checks your pantry before you start cooking to make sure you have all the ingredients (Data).
  2. Forces you to write a "Master Recipe" for chopping onions, so you don't have to write it out three times (Abstraction).
  3. Locks the oven until you are ready, so you can't accidentally add eggs to a cake that's already baking (State Management).

In short: Science is moving faster than ever, but the "recipes" scientists leave behind are often messy, missing ingredients, and impossible for others to follow. We need better tools to help scientists write code that is as reliable as their discoveries.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →