Why Do Software Bugs Seem to Appear Out of Nowhere?

  • Thread starter .Scott
  • Start date
  • Tags
    Course
  • #1
.Scott
Science Advisor
Homework Helper
3,541
1,644
TL;DR Summary
A EE coworker who's exploring software development just complained that his code that worked yesterday doesn't work now - and he hasn't changed anything.
An EE coworker who's exploring software development just complained that his code that worked yesterday doesn't work now - and he hasn't changed anything.

He said it within earshot of several more experienced programmers (including Yours Truly). The immediate reactions were chuckles and "yeah, that happens".

He has been informed that the patron saint for software engineering is Rod Serling.

The solution for this kind of problem is being methodical in the ways you copy, edit, back-up, and rebuild your source code and build files - so that you are less dependent on your own attention and memory when it comes time to replicate what you did yesterday. That said, as a practical matter, there is a balance between the cost of being methodical and the value of avoiding the Twilight zone. So if you're heading towards a career in SW engineering, expect occasional Rod Serling sightings on your commutes to work.

BTW: If you're Catholic, your unofficial patron saint of all computer matters is St Isidore of Seville - known for collecting data and encouraging the systematic used of the punctuation marks comma, period, and semicolon. He was schooled in the trivium and quadrivium (including semantics, arithmetic, and geometry) and lived a monk-like life. He created a very comprehensive collection (summa) of summaries of contemporary works . That summa was so authoritative and used so extensively that it inadvertently resulted in the loss of any copies of many of those original works. ... You may be better off sticking with Rod Serling.
 
Technology news on Phys.org
  • #2
.Scott said:
An EE coworker who's exploring software development just complained that his code that worked yesterday doesn't work now - and he hasn't changed anything.

He said it within earshot of several more experienced programmers (including Yours Truly). The immediate reactions were chuckles and "yeah, that happens".
I faced this a lot in the initial days of programming Android, especially when I didn't use any VCS. This has lessened now, but not completely gone. One problem, in my case, was that I was creating an alarm app. The Android system seems to randomly and mercilessly delete alarms set by apps which are not signed with a release key, but rather with a debug key. Signing with a release key and then testing on an emulator or physical device allowed the bugs, if any, to be more easily reproducible, and random behaviour by the Android system reduced.
 
  • #3
.Scott said:
An EE coworker who's exploring software development just complained that his code that worked yesterday doesn't work now - and he hasn't changed anything.
Often it's true that he hasn't changed anything. For example, have you heard about Y2K?
 
  • #4
It worked yesterday
But it does not work today
Software is like that
 
  • Like
Likes PeroK
  • #5
Friend of mine had a problem with one small assignment for a programming course - a javascript powered , three- or was it four-reeled gaming machine, on a webpage, with your prize being annouced in a pop-up window or a Try again if you had lost (and a click here to play gain to close the pop-up, of course. In his attempt it always worked the first time you pressed play, it never worked the second time you hit play. Refresh the screen, it worked again, then stopped again. Mine always worked every time. So I went through his code several times and couldn't find any error - he was a bit dyslexic and could occassionally make typos or have a : where it should be ; or a [ instead of { etc. "You'll just have to accept getting a lower grade for this one" I said. "It is something subtle I suspect."

We both submitted, we both got an A grade. I guessed that the lecturer had only tried one spin of the wheels, then given the code a look for efficiency or repetitiveness. I got a bit annoyed as I'd trouble shot my own effort very carefully and yet he got the same grade as me.
 
  • Like
Likes berkeman
  • #6
I had a python web service app encapsulated in a docker image, thinking it would always work. After a year of successful operation, my boss asked me to update it with some new features.

Stuff just broke, I eventually found the bug in some library I thought would never change, but it got updated. The culprit was a routine to read in a popular file format where there was a known header record with a lot of dead space in the header, and someone decided to "update" it to remove the dead space in our generated versions of these files which broke reading the third-party, public versions of these files.
 
  • #7
.Scott said:
He has been informed that the patron saint for software engineering is Rod Serling.
Another obvious candidate would be Murphy...
 
  • Like
Likes harborsparrow and .Scott
  • #8
PeterDonis said:
Another obvious candidate would be Murphy...
The downside of Murphy is that you may be tempted to look for a bug only in places where you think it could be.
 
  • Like
Likes anorlunda
  • #9
I always thought St George was the patron saint we needed as programmers.

When we encounter some new code, we think here there be dragons and who better than St George to fight them.
 
  • Like
Likes Tom.G
  • #11
I read the article and it brings up the programmer mantra of never using real words as variable or method or function or subroutine names.

In this case the programmer thought using the word “site” was okay until an update started checking or using it itself.
 
  • Like
Likes harborsparrow
Back
Top