Jump to content

Code rot

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Guinness2702 (talk | contribs) at 10:59, 28 October 2005 (mergeto software rot). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Code rot also known as Software rot is one of several forms of bit rot. It describes the perceived slow deterioration of software over time, that will eventually lead to it becoming faulty, unusable, or otherwise in need of maintenance.

Description

In fact, it is not possible for code to spontaneously metamorphasize over time (save for issues such as the decay of magnetically stored data, quantum tunnelling, and similar effects). The real 'cause' of the rot is the advancement or change of the environment in which the software operates. When a change occurrs, which the original program did not anticipate, the software may no longer operate as originally intended, and thus has 'rotted'.

Normal maintenance of software and systems do not cause rot as, when given proper consideration, the full impact of changes are taken into account and dealt with accordingly. However, it can be the case that unrelated systems are not updated as at the time of original change, because they are not relevant. Later, the unrelated system may become relevant, but not longer compatible.

Example

Consider the following sequence of events

  1. A database is created, storing data in character set A.
  2. The database contains text representations of hexadecimal numbers (e.g. "1a2b3")
  3. It is decided to convert the alphabetical charcters to uppercase (e.g. "1A2B3"), as this is more aesthetically pleasing.
  4. A tool "FixUPPER" is written to do this, dealing with character set A only.
  5. The database is converted to use character set B.
  6. Some data is accidentally loaded with lowercase characters in hexidecimal numbers.

"FixUPPER" cannot be used a second time to change the data, because it only supports character set A. Thus, it can be said to have rotted, although the actual cause was the conversion of the database to character set B.