Why Do Software Bugs Seem to Appear Out of Nowhere?

  • Thread starter Thread starter .Scott
  • Start date Start date
  • Tags Tags
    Course
Click For Summary
SUMMARY

The discussion centers on the phenomenon of software bugs appearing unexpectedly, often without any apparent changes made by the developer. Participants shared personal experiences, highlighting the importance of methodical practices in coding, such as using version control systems (VCS) and signing applications with release keys to minimize unpredictable behavior. The conversation humorously referenced Rod Serling as the "patron saint" of software engineering, emphasizing the inevitability of encountering elusive bugs. Additionally, the discussion touched on the impact of external factors, such as updates to libraries and frameworks, which can introduce new issues in previously stable code.

PREREQUISITES
  • Understanding of version control systems (e.g., Git)
  • Familiarity with Android app signing practices
  • Knowledge of debugging techniques in programming
  • Awareness of software dependency management
NEXT STEPS
  • Research best practices for using Git in software development
  • Learn about Android app signing and its impact on app stability
  • Explore debugging tools and techniques for identifying elusive bugs
  • Investigate dependency management tools like npm or Maven to handle library updates
USEFUL FOR

Software developers, especially those working with Android applications, programmers dealing with legacy code, and anyone interested in improving their debugging and version control practices.

.Scott
Science Advisor
Homework Helper
Messages
3,884
Reaction score
1,939
TL;DR
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
.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.
 
.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?
 
It worked yesterday
But it does not work today
Software is like that
 
  • Like
Likes   Reactions: PeroK
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   Reactions: berkeman
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.
 
.Scott said:
He has been informed that the patron saint for software engineering is Rod Serling.
Another obvious candidate would be Murphy...
 
  • Like
Likes   Reactions: harborsparrow and .Scott
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   Reactions: anorlunda
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   Reactions: 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   Reactions: harborsparrow