from IPython import display
PALM Lab, Fall 2014
Software complexity is "a measure of resources expended by a system [human or other] while interacting with a piece of software to perform a given task."
Basili, 1980
Many of the claims made for the efficacy and utility of new approaches to software engineering - structured methodologies, new programming paradigms, new tools, and so on. Evidence to support such claims is thin and such evidence, as there is, is largely anecdotal. Of proper scientific evidence there is remarkably little.
Futhermore, such as there is can be described as “black box”, that is, it demonstrates a correlation between the use of certain technique and an improvement in some aspect of the development. It does not demonstrate how the technique achieves the observed effect.
Francoise Detienne, 2001
One feature which all of these approaches have in common is that they begin with certain characteristics of the software and attempt to determine what effect they might have on the difficulty of various programmer tasks.
A more useful approach would be first to analyze the processes involved in the programmer tasks, as well as the paramters which govern the effort involved in those processes.
...one should start with the symptoms of complexity, which are all manifested in the mind, and attempt to understand the processes which produce those symptoms.
Cant, 1995
Category | Metric |
---|---|
Graph theoretic | McCabe's Cyclomatic Number |
Gill and Kemerer's Complexity Density | |
Woodward's Knots | |
Nejmeh's NPATH Complexity | |
Emerson's Cohension Metric | |
Textual | Line Count |
Character/Keyword Count | |
Douce's Spatial Complexity | |
Aggarwal's Function/Class Template Factors |
Category | Metric |
---|---|
Information theoretic | Chen's MIN (Nesting) |
Harrison's AICC | |
Halstead's Effort | |
Ramamarthy and Melton's Weighted Pair | |
Hansen's Complexity Pair | |
Davis and LeBlan's Entropy | |
Woodfield's Logical Module Complexity | |
Gannon's Number of Generic Packages | |
Veldhuzien's Minimum Description Length |
See Cant (1995) for complete listing
Any of the three submodels may become active at any time during the comprehension process.
von Mayrhauser (1995)
1 for i in [1, 2, 3, 4]:
2 print "The count is", i
3 print "Done counting"
1 for i in [1, 2, 3, 4]:
2 print "The count is", i
3
4
5 print "Done counting"
1 def add_1(num):
2 num = num + 1
3
4 def twice(num):
5 num = num * 2
6
7 added = 4
8 add_1(added)
9 twice(added)
10 add_1(added)
11 twice(added)
12 print added
1 def add_1(added):
2 added = added + 1
3
4 def twice(added):
5 added = added * 2
6
7 added = 4
8 add_1(added)
9 twice(added)
10 add_1(added)
11 twice(added)
12 print added
Term | Description |
---|---|
$R_F$ | Speed of recall or review (familiarity) |
$R_S$ | Chunk size |
$R_C$ | Type of control structure in which chunk is embedded |
$R_E$ | Difficulty of understanding complex Boolean or other expressions |
$R_R$ | Recognizability of chunk (conformance to expectations) |
$R_V$ | Effects of visual structure (separable from other chunks) |
$R_D$ | Disruptions caused by dependencies (due to short-term memory) |
$T_F$ | Dependency familiarity |
$T_L$ | Localization of dependency (local, remote, etc.) |
$T_A$ | Ambiguity of dependency source (many possibilities?) |
$T_S$ | Spatial distance (e.g., lines of code) |
$T_C$ | Level of cueing (obscurity of reference) |
Term | Description | ACT-R Module |
---|---|---|
$R_F$ | Speed of recall or review (familiarity) | DM |
$R_S$ | Chunk size | Visual |
$R_C$ | Type of control structure in which chunk is embedded | |
$R_E$ | Difficulty of understanding complex Boolean or other expressions | |
$R_R$ | Recognizability of chunk (conformance to expectations) | |
$R_V$ | Effects of visual structure (separable from other chunks) | Visual |
$R_D$ | Disruptions caused by dependencies (due to short-term memory) | DM |
$T_F$ | Dependency familiarity | DM |
$T_L$ | Localization of dependency (local, remote, etc.) | Visual |
$T_A$ | Ambiguity of dependency source (many possibilities?) | |
$T_S$ | Spatial distance (e.g., lines of code) | Visual |
$T_C$ | Level of cueing (obscurity of reference) | |
Delay from typing predicted output | Manual |
for
loop with bugfuncall
- function call with different spacinginitvar
- summation and factorialorder
- 3 functions called (in order/shuffled)overload
- overloaded + operator (number/strings)partition
- partition list of numberswhitespace
- linear equations[ most errors ] • [ fewer errors ] • [ no errors ]
Qualitative
Quantitative