pages tagged bitrotyakkinghttp://yakking.branchable.com/tags/bitrot/yakkingikiwiki2017-03-15T12:00:14ZWhat is this disgusting smell? On software bit rothttp://yakking.branchable.com/posts/bitrot/Lars Wirzenius2017-03-15T12:00:14Z2017-03-15T12:00:07Z
<p><a href="https://en.wikipedia.org/wiki/Software_rot">Bit rot</a>, specifically the phenomenon of software working less well
even if it hasn't changed, is annoying, but a fact of life. There
might be a thing or two you can do to make it happen less.</p>
<p>Examples from your author's personal experience from the past year:</p>
<ul>
<li>Cloud provider changes the default username on base images from
<code>ec2-user</code> to <code>debian</code>, requiring simple changes needed in many
places.</li>
<li>Cloud provider upgrades their virtualisation platform, which
introduces a new API version, and breaks the old version. All API
using automation needs upgrading.</li>
<li>Configuration management software introduces a new feature
(<code>become</code>), and deprecates the old corresponding feature (<code>sudo</code>).
Simple changes, but in many places.</li>
<li>Configuration management software breaks the new feature (can no
longer switch to an unprivileged user to run shell script snippets),
requiring more complicated changes in several places (run shell as
root, invoke sudo explicitly).</li>
<li>Author's software depends on enterprise-grade software for a
specific service, which switches to requiring Oracle Java, instead
of OpenJDK. Author's software isn't fully free software anymore.</li>
</ul>
<p>Bit rot happens for various reasons. The most common reason is that
the environment changes. For example, software that communicates over
the network may cease to function satisfactorily if the other
computers change. A common example is the web browser: even though
your computer works just as well as before, in isolation, web sites
use new features of HTML, CSS, and JavaScript, not to mention media
formats, and web pages become bigger, and in general everything
becomes heavier. Also, as your browser version ages, sites stop caring
about testing with it, and start doing things that expose bugs in your
version. Your web experience becomes worse every year. Your browser
bit rots.</p>
<p>There is no way to prevent bit rot. It is a constant that everything
is variable. However, you can reduce it by avoiding common pitfalls.
For example, avoid dependencies that are likely to change,
particularly in ways that will break your software. An HTML parsing
library will necessarily change, but that shouldn't break your
software if the library provdes a stable API. If the library adds
support for a new syntactic construction in HTML, your program should
continue to work as before.</p>
<p>You should be as explicit as possible in what you expect from the
environment. Aim to use standard protocols and interfaces. Use
standard POSIX system calls, when possible, instead of experimental
Linux-specific ones from out-of-tree development branches. Sometimes
that isn't possible: document that clearly.</p>
<p>Have automated ways of testing that your software works, preferably
tests that can be run against an installed instance. Run those tests
from time to time. This will let you and your users notice earlier
that something's broken.</p>