TrendPulse Logo

Got bugs? Here’s how to catch the errors in your scientific software

Source: NatureView Original
scienceApril 20, 2026

-

Email

-

Bluesky

-

Facebook

-

LinkedIn

-

Reddit

-

Whatsapp

-

X

Illustration: The Project Twins

Science is becoming increasingly computational. Experimental data must be logged, cleaned, checked and analysed. Data analysis often involves iterative trial and error using ‘scripting’ programming languages such as Python and R. The outputs of such programs are then included in papers, presentations and grant applications.

A typical piece of professional software contains up to 50 errors per 1,000 lines of code (D. A. W. Soergel F1000Research 3, 303; 2015). But scientific code, which is written mainly by graduate students and postdocs who have little to no training in software development, is even more error-prone. Self-taught coders — and the artificial-intelligence-driven assistants they sometimes use — can create programs that seem to work yet generate nonsense, says computer scientist Amy Ko at the Information School at the University of Washington in Seattle. “If you have a program that computes something, it doesn’t mean that it’s correct.”

How to fix your scientific coding errors