ABC Software Metric
The ABC software metric was introduced by Jerry Fitzpatrick in 1997 to overcome the drawbacks of the LOC.
≈ 3 min read
Names in other languages
No names in other languages are held for this entry yet.
Article bodies are English and are not machine-translated. A name in another language is not a translation of the article.
The ABC software metric was introduced by Jerry Fitzpatrick in 1997 to overcome the drawbacks of the LOC. The metric defines an ABC score as a triplet of values that represent the size of a set of source code statements. An ABC score is calculated by counting the number of assignments (A), number of branches (B), and number of conditionals (C) in a program.
ABC score can be applied to individual methods, functions, classes, modules or files within a program. ABC score is represented by a 3-D vector . It can also be represented as a scalar value, which is the magnitude of the vector , and is calculated as follows: :: | | = \sqrt{A^2 + B^2 + C^2} By convention, an ABC magnitude value is rounded to the nearest tenth.
The ABC software metric was introduced by Jerry Fitzpatrick in 1997 to overcome the drawbacks of the LOC. The metric defines an ABC score as a triplet of values that represent the size of a set of source code statements. An ABC score is calculated by counting the number of assignments (A), number of branches (B), and number of conditionals (C) in a program.
ABC score can be applied to individual methods, functions, classes, modules or files within a program. ABC score is represented by a 3-D vector . It can also be represented as a scalar value, which is the magnitude of the vector , and is calculated as follows: | | = \sqrt{A^2 + B^2 + C^2} By convention, an ABC magnitude value is rounded to the nearest tenth.
Occurrence of an assignment operator (=, *=, /=, %=, +=, -=, >=, &=, !=, ^=). Occurrence of an increment or a decrement operator (++, --). Add one to branch count when: Occurrence of a function call.
Occurrence of any goto statement which has a target at a deeper level of nesting than the level to the goto. Add one to condition count when: Occurrence of a conditional operator ( , =, ==, !=). Occurrence of the following keywords (‘else’, ‘case’, ‘default’, ‘?’).
Occurrence of a unary conditional operator. Occurrence of an assignment operator (exclude constant declarations and default parameter assignments) (=, *=, /=, %=, +=, -=, >=, &=, !=, ^=). Occurrence of an increment or a decrement operator (prefix or postfix) (++, --).
Initialization of a variable or a nonconstant class member. Add one to branch count when: Occurrence of a function call or a class method call. Occurrence of any goto statement which has a target at a deeper level of nesting than the level to the goto.
Occurrence of ‘new’ or ‘delete’ operators. Add one to condition count when: Occurrence of a conditional operator ( , =, ==, !=). Occurrence of the following keywords (‘else’, ‘case’, ‘default’, ‘?’, ‘try’, ‘catch’).
Occurrence of a unary conditional operator. Occurrence of an assignment operator (exclude constant declarations and default parameter assignments) (=, *=, /=, %=, +=, -=, >=, &=, !=, ^=, >>>=). Occurrence of an increment or a decrement operator (prefix or postfix) (++, --).
Add one to branch count when Occurrence of a function call or a class method call. Occurrence of a ‘new’ operator. Add one to condition count when: Occurrence of a conditional operator ( , =, ==, !=).
Occurrence of the following keywords (‘else’, ‘case’, ‘default’, ‘?’, ‘try’, ‘catch’). Occurrence of a unary conditional operator.
Text derived from https://en.wikipedia.org/w/index.php?oldid=1341197301 under CC BY-SA 4.0; modifications have been made.