Content deleted Content added
m Bot: Migrating 1 interwiki links, now provided by Wikidata on d:q7248499 |
Adding short description: "Attribute of a software system" |
||
(29 intermediate revisions by 24 users not shown) | |||
Line 1:
{{Short description|Attribute of a software system}}
{{Distinguish|Computational complexity theory}}'''Programming complexity''' (or '''software complexity''') is a term that
The idea of linking software complexity to software maintainability has been explored extensively by [[Meir M. Lehman|Professor Manny Lehman]], who developed his [[Lehman's laws of software evolution|Laws of Software Evolution]]. He and his co-author [[Les Belady]] explored numerous [[software metrics]] that could be used to measure the state of software, eventually concluding that the only practical solution is to use deterministic complexity models.<ref>MM Lehmam LA Belady; Program Evolution - Processes of Software Change 1985</ref>
==Measures==▼
Many measures of software complexity have been proposed. Many of these, although yielding a good representation of complexity, do not lend themselves to easy measurement. Some of the more commonly used metrics are▼
* [[cyclomatic complexity|McCabes cyclomatic complexity metric]]▼
* [[Halstead complexity measures|Halsteads software science metrics]]▼
* Henry and Kafura introduced Software Structure Metrics Based on Information Flow in 1981<ref>Henry, S.; Kafura, D. IEEE Transactions on Software Engineering Volume SE-7, Issue 5, Sept. 1981 Page(s): 510 - 518</ref> which measures complexity as a function of fan in and fan out. They define fan-in of a procedure as the number of local flows into that procedure plus the number of data structures from which that procedure retrieves information. Fan-out is defined as the number of local flows out of that procedure plus the number of data structures that the procedure updates. Local flows relate to data passed to and from procedures that call or are called by, the procedure in question. Henry and Kafura's complexity value is defined as "the square of procedure length multiplied by fan-in multiplied by fan-out."▼
==Types==▼
* A Metrics Suite for Object Oriented Design<ref>Chidamber, S.R.; Kemerer, C.F. IEEE Transactions on Software Engineering Volume 20, Issue 6, Jun 1994 Page(s):476 - 493</ref> was introduced by Chidamber and Kemerer in 1994 focusing, as the title suggests, on metrics specifically for object oriented code. They introduce six OO complexity metrics; weighted methods per class, coupling between object classes, response for a class, number of children, depth of inheritance tree and lack of cohesion of methods▼
#'''Accidental complexity''' relates to difficulties a programmer faces due to the software engineering tools. Selecting a better tool set or a higher-level programming language may reduce it. Accidental complexity often results from not using the ___domain to frame the form of the solution.{{Citation needed|date=September 2015}} [[Domain-driven design]] can help minimize accidental complexity.
#'''Essential complexity
▲==Measures==
▲
▲* Henry and Kafura introduced "Software Structure Metrics Based on Information Flow" in 1981,<ref>Henry, S.; Kafura, D. IEEE Transactions on Software Engineering Volume SE-7, Issue 5, Sept. 1981 Page(s): 510 - 518</ref> which measures complexity as a function of "fan
▲* Chidamber and Kemerer introduced "A Metrics Suite for Object
* Branching complexity (Sneed Metric)
* Data access complexity (Card Metric)
Line 15 ⟶ 22:
* Data flow complexity (Elshof Metric)
* Decisional complexity (McClure Metric)
*Path Complexity (Bang Metric)
[[Law of conservation of complexity|Tesler's Law]] is an [[adage]] in [[human–computer interaction]] stating that every [[Application software|application]] has an inherent amount of complexity that cannot be removed or hidden.
▲==Types==
▲Associated with, and dependent on the complexity of an existing program, is the complexity associated with changing the program. The complexity of a problem can be divided into two parts:<ref>[http://academia.edu.documents.s3.amazonaws.com/1811257/SHSM2011.pdf In software engineering, a problem can be divided into its accidental and essential complexity [1<nowiki>]</nowiki>.]</ref>
▲#Essential complexity: Is caused by the characteristics of the problem to be solved and cannot be reduced.
==Chidamber and Kemerer Metrics==
==References==▼
{{Prose|date=August 2017}}
{{Reflist}}▼
Chidamber and Kemerer<ref name=":0" /> proposed a set of programing complexity metrics widely used in measurements and academic articles: weighted methods per class, coupling between object classes, response for a class, number of children, depth of inheritance tree, and lack of cohesion of methods, described below:
* Weighted methods per class ("WMC")
** <math>WMC = \sum_{i=1}^nc_i</math>
** n is the number of methods on the class
** <math>c_i</math> is the complexity of the method
* Coupling between object classes ("CBO")
** number of other class which is coupled (using or being used)
* Response for a class ("RFC")
** <math>RFC = |RS|</math> where
** <math>RS = \{M\}\cup_{all\ i} \{R_i\}</math>
** <math>R_i</math> is set of methods called by method i
** <math>M</math> is the set of methods in the class
* Number of children ("NOC")
** sum of all classes that inherit this class or a descendant of it
* Depth of inheritance tree ("DIT")
** maximum depth of the inheritance tree for this class
* Lack of cohesion of methods ("LCOM")
** Measures the intersection of the attributes used in common by the class methods
** <math>LCOM = \begin{cases} |P| - |Q|, & \text{if } |P| > |Q|
\\0, & \text{otherwise } \end{cases}</math>
** Where <math>P = \{ (I_i,I_j)|I_i\cap I_j = \emptyset\}</math>
** And <math>Q = \{(I_i, I_j)|I_i \cap I_j \neq \emptyset\}</math>
** With <math>I_i</math> is the set of attributes (instance variables) accessed (read from or written to) by the <math>i</math>-th method of the class
==See also==
*[[Programming paradigm]]
*[[Software crisis]]
▲==References==
▲{{Reflist}}
[[Category:Software metrics]]
[[Category:Complex systems theory]]
|