Answering: “Which metric is LEAST useful when measuring code maintainability?”

Table of Contents

Measuring Code Maintainability

Code maintainability is crucial for ensuring that software can be easily modified, extended, and understood over time. Various metrics are used to assess the maintainability of code, but some metrics are more relevant to this purpose than others.

Exam Question

Which metric is LEAST useful when measuring code maintainability?
(choose the best answer)
A. Function points.
B. Depth of inheritance.
C. Cyclomatic complexity.

Correct Answer

A. Function points.

Explanation

Correct Answer

A. Function points:
Function points measure the functional size of a software application, focusing on the functionality delivered to the user. While they are useful for assessing the scope or size of a project, they do not directly measure the maintainability of the code. Function points are more about what the software does rather than how maintainable the underlying code is.

Why the Other Options Are More Relevant

B. Depth of inheritance:
Depth of inheritance is a metric that relates to the complexity of the object-oriented design. It indicates how deeply a class is nested in the inheritance hierarchy. A deeper inheritance structure can make the code more difficult to maintain because changes in higher-level classes can have wide-ranging effects on subclasses. Therefore, it is a relevant metric for measuring code maintainability.

C. Cyclomatic complexity:
Cyclomatic complexity measures the number of linearly independent paths through a program’s source code. It is directly related to the complexity of the code and how difficult it might be to test, understand, and maintain. Higher cyclomatic complexity generally indicates more complex, harder-to-maintain code, making it a highly relevant metric for maintainability.

Relevance to the PSD Exam

Understanding which metrics are most relevant for assessing code maintainability is important for the PSD exam. It helps in evaluating the quality of the code and ensuring that the software remains easy to manage and extend over time.

Key Takeaways

  • Function points are more about functional size and do not directly relate to code maintainability.
  • Depth of inheritance and cyclomatic complexity are important metrics for assessing how maintainable code is, focusing on complexity and design aspects.
  • Choosing the right metrics is crucial for ensuring that the codebase remains maintainable and adaptable as the software evolves.

Conclusion

When assessing code maintainability, function points are the least useful metric compared to depth of inheritance and cyclomatic complexity. Understanding these differences is essential for making informed decisions about code quality. For more information on preparing for the PSD exam, visit our Professional Scrum Developer PSDâ„¢ Exam Prep.

Sign up for more exam tips and discounts



You cannot copy content of this page

$35 Exam Preps

Sale Ending Soon

Day
Hour
Min
Sec
Offer Expired
Add Your Heading Text Here