Software entropy is the idea that software eventually rots as it is changed if sufficient care is not taken to maintain coherence with product design and established design principles. The common usage is only tangentially related to entropy as defined in classical thermodynamics and statistical physics.
Another aspect can be found in what is perceived to be a decay in the quality of otherwise static software that is the result of the inevitable changes to its environment, that often occur as operating systems and other components are upgraded or retired.
- The second law of thermodynamics, in principle, states that a closed system's disorder cannot be reduced, it can only remain unchanged or increase. A measure of this disorder is entropy. This law also seems plausible for software systems; as a system is modified, its disorder, or entropy, tends to increase. This is known as software entropy.
- Within software development, there are similar theories; see Lehman (1985), who suggested a number of laws, of which two were, basically, as follows:
Relation to information theory
Software source code is information
The purpose of writing software is to encode domain and design knowledge, in source form(s) that can be translated to executable destination format(s). As such, to the extent that the source is a coherent, noise free encoding of the relevant knowledge sets, its entropy may be considered to be low. After initial development and acceptance, the code enters the maintenance phase of the software lifecycle, where it may be allowed to accumulate defects (noise), represented by divergence from those knowledge sets (domain and software design principles), and thereby increase the entropy of the software.
Relation to complexity
While there are known correlations (see software complexity), there is no direct relationship between software complexity and software entropy. Any two pieces of software, with equivalent complexity levels, can exist at different levels of entropy or rot. Even a very simple program, can suffer high levels of entropy as it passes through the hands of multiple developers.
The process of code refactoring can result in stepwise reductions in software entropy.
- Feature creep
- Software bloat
- Software brittleness
- Software rot
- Fail-fast programming pattern to reduce software entropy
- Algorithmic information theory
- Jacobson, Ivar; Christerson, Magnus; Jonsson, Patrik; Övergaard, Gunnar (1992), Object-Oriented Software Engineering: A Use Case Driven Approach, ACM Press. Addison–Wesley, pp. 69–70, ISBN 0-201-54435-0
- Lehman, M. M.; Belady, L.A. (1985), Program evolution: processes of software change, Academic Press, ISBN 9780124424401
- Hunt, Andrew; Thomas, David (1999), The Pragmatic Programmer, Addison Wesley, ISBN 0-201-61622-X – Item 4 (of 22 tips) is Don't Live with Broken Windows.
- Wojnowicz, Michael; Chisholm, Glenn; Wolff, Matt; Zhao, Xuan (2016). "Wavelet decomposition of software entropy reveals symptoms of malicious code". Journal of Innovation in Digital Ecosystems. 3 (2): 130–140. doi:10.1016/j.jides.2016.10.009.