next up previous
Next: Interface Complexity Up: Size Previous: Size


Lines of Code ($ LOC$ )

Works only with instances of the common meta-model which were created by a front-end calculating this metric and attaching its value as property to the specific elements. Currently only the Eclipse Java Front-end supports this, the UML Front-end can of course not calculate this metric, since there is no source code in UML.
Handle
$ LOC$
Description
Lines of code simply counts the lines of source code (line break characters) of a certain software entity. It is a simple yet powerful metric to assess the complexity of software entities. Since it is depending on code conventions and format, it is critical to use it in generated codes since it may lack of line breaks. Additionally it can only be measured in the source code itself from the front-end and is therefore a front-end side metric.
Scope
Method, Class, Compilation unit
View
$ {V}^{LOC} = ({G}^{LOC}, {R}^{LOC})$
  • Grammar $ {G}^{LOC} = (\{\textrm{scope}^{LOC}\}, \emptyset, \textrm{scope}^{LOC})$
  • Relations $ {R}^{LOC}: \emptyset$
  • Mapping $ \alpha^{LOC}$:
    $\displaystyle \alpha^{LOC}(\textrm{Class})$ $\displaystyle \mapsto$ $\displaystyle \textrm{scope}^{LOC}$  
    $\displaystyle \alpha^{LOC}(\textrm{Method})$ $\displaystyle \mapsto$ $\displaystyle \textrm{scope}^{LOC}$  
    $\displaystyle \alpha^{LOC}(\textrm{CompilationUnit})$ $\displaystyle \mapsto$ $\displaystyle \textrm{scope}^{LOC}$  

Definition
The $ LOC$value of a element $ s \in scope^{LOC}$is defined as:
$\displaystyle LOC(s)$ $\displaystyle =$ $\displaystyle s.loc$  

Scale
Absolute.
Domain
Integers $ \in 0..\infty$.
Highly Related Software Quality Properties
 
Re-Usability 2.4
is both negatively and positively influenced by size.
Understandability for Reuse 2.4.1:
Understanding whether a software entity $ E$is suitable for reuse, or not, depends on its size.

Understandability declines with increasing LOC.

Attractiveness 2.4.4:
Attractiveness of a software entity $ E$depends on the size of the potentially reused code.

Attractiveness increases with increasing LOC.

Maintainability 2.6
declines with increasing LOC.
Analyzability 2.6.1:
The effort and time for diagnosis of deficiencies or causes of failures in a software entity, or for identification of parts to be modified is directly related to its size.

Analyzability declines with increasing LOC.

Changeability 2.6.2:
Changing a software entity requires prior understanding, which, in turn, is more complicated for large systems.

Changeability declines with increasing LOC.

Testability 2.6.4:
Complete testing requires coverage of all execution paths. The number of possible execution paths of a software entity increases with its size.

Testability declines with increasing LOC.

Portability 2.7
declines with increasing LOC.
Adaptability 2.7.1:
As for changeability 2.6.2, the size of a software entity has a direct impact. Each modification requires understanding which is more complicated for large systems.

Adaptability declines with increasing LOC.

Related Software Quality Properties
 
Functionality 2.1
might increase with increasing LOC.
Interoperability 2.1.3:
Interoperability requires to be able to locate the parts of a system responsible for interoperability. The size of these parts might indicate a better ability to interact.

Interoperability might increase with increasing LOC.

Security 2.1.4:
Relating LOC to security requires to be able to locate the parts of a system responsible for security. The size of these parts might indicate a higher security.

Security might increase with increasing LOC.

Reliability 2.2
might increase with increasing LOC.
Maturity 2.2.1:
Due to reduced analyzability 2.6.1 and testability 2.6.4, bugs might be left in the software. Therefore, also maturity may be influenced negatively by code size.

Maturity might decline with increasing LOC.

Fault-tolerance 2.2.2:
Relating LOC to fault-tolerance requires to be able to locate the parts of a system responsible for fault-tolerance. The size of these parts might indicate a better ability to interact.

Fault-Tolerance might increase with increasing LOC.

Recoverability 2.2.3:
Relating LOC to recoverability requires to be able to locate the parts of a system responsible for recoverability. The size of these parts might indicate a higher recoverability.

Recoverability might increase with increasing LOC.

Re-Usability 2.4
might decrease with increasing LOC.
Learnability for Reuse 2.4.2:
Learning if a software entity is suitable for reuse depends on the size and complexity of its interface. LOC is a general size metric, but not specifically assessing interface size and complexity.

Learnability might decline with increasing LOC.

Operability for Reuse - Programmability 2.4.3:
How well a class can be integrated depends the complexity of its interface. LOC is a general size metric, but not specifically assessing interface size and complexity.

Programmability might decline with increasing LOC.

Efficiency 2.5
might decline with increasing LOC.
Time Behavior 2.5.1:
Static size might indicate a higher execution time due to increased number of instruction cache misses, long jumps, etc.

Time behavior might get worse with increasing LOC.

Resource Utilization 2.5.2:
Static size might indicate a higher memory utilization.

Resource utilization might get worse with increasing LOC.

Maintainability 2.6
declines with increasing LOC.
Stability 2.6.3:
Due to reduced analyzability 2.6.1 and testability 2.6.4, also stability may be influenced negatively by size.

Stability might decline with increasing LOC.

Portability 2.7
declines with increasing LOC.
Replaceablity 2.7.4:
The substitute of a component must imitate its observable behavior. Large components have the potential of a more complex observable behavior making it more difficult to check substitutability and to actually substitute a component. Interface size and complexity, an attribute directly connected to replaceability, is not specifically assessed by LOC.

Replaceablity might declines with increasing LOC.

References
 
  • LOC is extensively discussed in [13, p22], [2, p22],
  • and evaluated in a case study [19],
  • it is implemented in the VizzAnalyzer Metrics Suite.

next up previous
Next: Interface Complexity Up: Size Previous: Size
Copyright © 2008-2009, ARiSA AB. Phone: +46-(0)470 70 8495 Email: info@arisa.se Valid CSS! Valid XHTML 1.0 Transitional