principles:more_is_more_complex
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
principles:more_is_more_complex [2013-01-16 18:07] – [Rationale] christian | principles:more_is_more_complex [2021-10-20 21:22] – old revision restored (2017-02-16 11:41) christian | ||
---|---|---|---|
Line 3: | Line 3: | ||
===== Variants and Alternative Names ===== | ===== Variants and Alternative Names ===== | ||
- | * Miller' | + | * Less is more |
===== Context ===== | ===== Context ===== | ||
/* fill in contexts here: */ | /* fill in contexts here: */ | ||
- | * [[contexts: | + | * [[contexts: |
+ | * [[contexts: | ||
+ | * [[contexts: | ||
+ | * [[contexts: | ||
+ | * [[contexts: | ||
+ | * [[contexts: | ||
===== Principle Statement ===== | ===== Principle Statement ===== | ||
Line 17: | Line 21: | ||
===== Description ===== | ===== Description ===== | ||
- | Having more lines of code, methods, classes, packages, executables, | + | Having more lines of code, methods, classes, packages, executables, |
- | * seven lines of code per method | + | |
- | * seven methods per class | + | |
- | * seven classes | + | |
- | * etc. | + | |
- | Of course this is not possible in a realistically-sized software system. So more realistic values can be debated. Seven parameters to a method is quite much and can be regarded way too many. On the other hand seven methods per class and seven classes per subsystems are usually too few. Also seven lines of code per method | + | There is both: too large modules (i.e. undermodularization) |
- | This means that given the complexity of the problem | + | Note that it is actually not the number of lines, |
- | Furthermore | + | For documentation |
===== Rationale ===== | ===== Rationale ===== | ||
- | The human brain can only handle | + | The capabilities of the human mind are certainly limited. If it is necessary to keep a large amount of modules |
- | While the human short-term memory is far more complex than can be expressed in a catchphrase like " | + | Regarding documentation |
===== Strategies ===== | ===== Strategies ===== | ||
- | * Divide | + | * Avoid many modules |
- | * Don't introduce a new module | + | * Merge several modules into one |
+ | * Don't introduce | ||
+ | * Avoid big modules | ||
+ | * Divide large modules | ||
+ | * Introduce new modules to group related functionality. A [[patterns: | ||
+ | |||
+ | ===== Caveats ===== | ||
+ | |||
+ | * Note that [[Miller's Law]] is often cited in this context but it is doubtful | ||
+ | * Note that this principle is contrary to itself. Given a desired functionality a certain level of complexity in inevitable. This leads in the extremes either to a large amount of small classes or a large amount of code in a fewer class. The same applies on other levels like number and size of methods, etc. So there is always a tradeoff between MIMC and itself applied to different aspects of the software system. | ||
+ | * Furthermore note that having more classes can be regarded better than having too large classes. See [[Add More Classes]]. | ||
+ | * Having no documentation is best with respect to MIMC. But of course there are contrary principles. | ||
+ | |||
+ | See also section [[#contrary principles]]. | ||
===== Origin ===== | ===== Origin ===== | ||
- | * For the short-term memory capacity limit being around "seven plus or minus two" also known as " | + | The phrase "more is more complex" |
- | * The phrase "more is more complex" | + | |
===== Evidence ===== | ===== Evidence ===== | ||
/* Comment out what is not applicable and explain the rest: */ | /* Comment out what is not applicable and explain the rest: */ | ||
- | * [[wiki: | + | /* * [[wiki:Proposed]]*/ |
- | + | ||
- | /* * [[wiki:Examined]]*/ | + | |
/* * [[wiki: | /* * [[wiki: | ||
- | /* * [[wiki: | ||
+ | [[wiki: | ||
+ | |||
+ | This phenomenon that the defect density is high for small modules but also rises for large modules is called the " | ||
+ | |||
+ | This sounds intuitive but the Goldilocks Conjecture is disputed. Some point out that the negative correlation between defect density and size is just a mathematical artifact((Jarrett Rosenberg: //Some Misconceptions About Lines of Code// | ||
+ | |||
+ | The relationship between module size and defect proneness is complex and not clear. Furthermore modularization is not only a task in terms of module size. The more interesting aspect is how to assign responsibilities to modules. So apart from module size there are many other aspects influencing modularization (see especially [[Model Principle|MP]], | ||
+ | |||
+ | This is an important research question but as MIMC is just a qualitative rule of thumb (just as the other principles are). So the principle can be deemed helpful despite the Goldilocks Conjecture being disputed. | ||
+ | |||
+ | As a specific aspect of MIMC, complexity through deep inheritance relations is known to reduce effectiveness and efficiency of maintenance. There are controlled experiments showing this((John Daly, Andrew Brooks, James Miller, Marc Roper and Murray Wood: //An Empirical Study Evaluating Depth of Inheritance on the Maintainability of Object-Oriented Software// | ||
+ | |||
+ | [[wiki: | ||
===== Relations to Other Principles ===== | ===== Relations to Other Principles ===== | ||
Line 62: | Line 84: | ||
==== Generalizations ==== | ==== Generalizations ==== | ||
- | * [[principles:Keep It Simple Stupid]] (KISS): MIMC states that having more modules, etc. leads to more complexity. KISS on the other hand is about the avoidance of every form of complexity. | + | * [[Keep It Simple Stupid]] (KISS): MIMC states that having more modules, etc. leads to more complexity. KISS on the other hand is about the avoidance of every form of complexity. |
==== Specializations ==== | ==== Specializations ==== | ||
Line 71: | Line 93: | ||
* **More Is More Complex (MIMC)**: Changing a design to adhere to the MIMC principle may always lead to more complexity concerning another aspect of the system. For example reducing the amount of code in a large method is typically achieved by the introduction of further methods. So there is always a tradeoff between this principle and itself. | * **More Is More Complex (MIMC)**: Changing a design to adhere to the MIMC principle may always lead to more complexity concerning another aspect of the system. For example reducing the amount of code in a large method is typically achieved by the introduction of further methods. So there is always a tradeoff between this principle and itself. | ||
- | * **[[principles:High Cohesion]] (HC)**: Not introducing further modules typically leads to a lower cohesion. | + | * **[[High Cohesion]] (HC)**: Not introducing further modules typically leads to a lower cohesion. |
+ | * [[Add More Classes]]: While MIMC is a very general principle that applies to virtually everything, it may be regarded better to have more classes than bigger classes. | ||
+ | * [[More Stakeholders, | ||
+ | * [[Navigation Avoidance Principle]] (NAP): When trying to minimize documentation try not to create the need for navigation. | ||
==== Complementary Principles ==== | ==== Complementary Principles ==== | ||
+ | |||
+ | * [[Miller' | ||
+ | * [[Document the Hard Stuff]] (DHS): When trying to minimize documentation DHS tells you what you should document and what you can leave out. | ||
+ | * [[Don' | ||
==== Principle Collections ==== | ==== Principle Collections ==== | ||
Line 79: | Line 108: | ||
{{page> | {{page> | ||
- | ===== Example | + | |
+ | ===== Examples | ||
FIXME | FIXME | ||
+ | |||
===== Description Status ===== | ===== Description Status ===== | ||
Line 91: | Line 122: | ||
===== Further Reading ===== | ===== Further Reading ===== | ||
+ | ===== Discussion ===== | ||
+ | Discuss this wiki article and the principle on the corresponding [[talk: |
principles/more_is_more_complex.txt · Last modified: 2021-10-20 21:26 by christian