Listed below are some possible findings from static analysis of a component containing approximately 1,000 lines of code. Which combination suggests that the component does NOT need refactoring for better maintainability?
A) Low measure of coupling.
B) Low measure of cohesion.
C) Low measure of commenting.
D) Low measure of complexity.
E) High measure of coupling.
F) High measure of cohesion.
G) High measure of commenting.
H) High measure of complexity.
Correct Answer: D
When evaluating a component for maintainability, several metrics are considered:
* Coupling: Refers to the degree of interdependence between software modules. Lower coupling is preferred for maintainability.
* Cohesion: Refers to how closely related the responsibilities of a single module are. Higher cohesion within modules is preferred.
* Commenting: Refers to the presence of comments within the code. While useful, excessive commenting is not necessarily an indicator of maintainability.
* Complexity: Refers to the complexity of the code, often measured by metrics like cyclomatic complexity. Lower complexity is preferred.
Given these metrics:
* d. Low measure of complexity: Indicates the code is simple and straightforward, which enhances maintainability.
* f. High measure of cohesion: Indicates that modules have clear, well-defined responsibilities, enhancing maintainability.
* h. High measure of complexity: This should generally be low for better maintainability, but in this context, the assumption is an erroneous inclusion in the preferred list.
Thus, the best combination suggesting that the component does NOT need refactoring for better maintainability is d, f, h.
References:
* The selection of metrics and their desired values are based on software engineering principles covered in the ISTQB CTAL-TTA syllabus, which emphasizes low complexity and high cohesion for maintainable software design.