Metrics and Measurements
play a pivotal role in the management and improvement of software development
and testing processes. They offer quantitative data that aids in gauging the
quality, effectiveness, and progress of software or a software project.
Types of Metrics
- Product Metrics: These measure the
characteristics of the software product itself. They are generally
associated with the software's quality, complexity, size, design features,
performance, and reliability. Examples include Lines of Code (LOC),
Cyclomatic Complexity, Defect Density, and Code Coverage.
- Process Metrics: These measure the
efficiency and effectiveness of the software development process. They
offer insights on how well the processes are performing and assist in
identifying areas of improvement to produce higher quality software.
Examples include Phase-based Defect Removal Pattern, Defect Detection
Percentage (DDP), and Process Cycle Time.
Object-Oriented Metrics in
Testing
Object-oriented metrics are a
subcategory of product metrics specifically designed for object-oriented
programming and systems. These metrics can help identify potential issues in
the design and implementation of an object-oriented system, thereby assisting
in improving the quality and maintainability of the software. Some commonly
used object-oriented metrics include:
- Class Size: This refers to the number of
attributes and methods in a class. A large number of attributes or methods
can suggest that the class may be too complex and might need to be
refactored.
- Depth of Inheritance Tree (DIT): This refers
to the number of class inheritance levels. A deep inheritance tree can
indicate high complexity and low modifiability.
- Number of Children (NOC): This represents
the number of immediate subclasses of a class. A high number of children
could indicate a high level of reuse, but could also be a sign of improper
abstraction.
- Coupling Between Object Classes (CBO): This
measures how much a class relies on other classes. High coupling could
indicate a higher likelihood of errors and more difficulty in making
changes.
- Response For a Class (RFC): This measures
the number of methods that can potentially be executed in response to a
message received by an object of that class. High RFC values may indicate
high complexity.
- Lack of Cohesion in Methods (LCOM): This
measures how well the methods of a class are related to each other. High
LCOM values may indicate that a class has more than one responsibility and
might need to be broken down into smaller classes.
Remember, while these metrics
provide valuable insights, they should be used judiciously and in conjunction
with other information to assess the overall quality of the software and its
development process.