TechyCluster Engineering Why stress teams are replacing spreadsheets with tested code

Why stress teams are replacing spreadsheets with tested code


Lines of program code on a dark laptop screen

A spreadsheet is the fastest way to start a calculation and one of the hardest places to check it. Stress teams, who may run the same sum across hundreds of load cases, are finding that out and moving repeat work into short, tested programs.

What goes wrong in a workbook

The evidence on spreadsheet quality is not flattering. Raymond Panko's long-running research on spreadsheet errors concludes that most large spreadsheets will contain errors, because small error rates per cell compound quickly. The best-known case is in finance. Accounts of JPMorgan's 2013 task force report on the London Whale losses describe a risk model that relied on manual spreadsheet steps and contained a formula mistake.

An engineering workbook has its own weaknesses. Logic hides in cells, so a reviewer must click through to see it. Copying a sheet for each new part creates versions that slowly drift apart. Nothing warns anyone when one pasted row breaks a formula.

What tested code changes

A short Python function does one job, and its formula sits in plain view. More importantly, it can carry a test: a known textbook answer that the code must reproduce every time it runs. If someone changes the function and breaks it, the test fails at once.

That is the important word in the shift. The aim isn't code for its own sake. It is a calculation that proves itself repeatedly, which matters where the output supports a safety argument such as the margin of safety we covered yesterday.

Scale is the second gain. A loop can run every load case, find the critical one and write out a table, where a workbook would need another round of copying. The same run can produce plots and report sections, which removes a stage where numbers get mistyped.

Where the spreadsheet still wins

This isn't a case for deleting Excel. Spreadsheets remain excellent for quick sums and for sharing a table with a colleague. The argument is about calculations that are repeated, reviewed and relied upon.

AI assistants have also lowered the entry cost, since they can draft working code from a clear prompt. They don't remove the need for checking, though. An unverified script is only a faster way to be wrong, which is why the tests matter more than the language. Teams wary of sending data to the cloud can look at running a model locally.

Sandeep Bandyopadhyay, who writes this site, has also written four engineering books on GD&T, airframe stress analysis and Python. They are described on one page.

Related gear

Disclosure: some links in this article are affiliate links or our editor's own courses and book. If you buy through them, TechyCluster or its editor may earn money at no extra cost to you. This does not influence what we cover or how we cover it. As an Amazon Associate, TechyCluster earns from qualifying purchases.

Sources

  1. Raymond Panko: Spreadsheet Errors: What We Know. What We Think We Can Do
  2. The Baseline Scenario: The Importance of Excel

Leave a Reply

Your email address will not be published. Required fields are marked *