Software engineering — modular design quality: Which of the following best measures how good or bad a module's design is?
-
AModule strength (cohesion)
-
BModule coupling
-
CBoth module strength and module coupling
-
DStatic analysis only
-
ENone of the above
Answer
Correct Answer: Both module strength and module coupling
Explanation
Introduction / Context:Modular design aims to build software as a set of well-structured, maintainable modules. Two foundational quality measures are cohesion (often called module strength) and coupling (the degree of interdependence). This question asks which measures evaluate modular design quality.
Given Data / Assumptions:
- Cohesion reflects how strongly responsibilities within a module relate to each other.
- Coupling reflects how much a module depends on other modules.
- Static analysis is a technique that can help compute or infer metrics, but it is not itself a design quality metric.
Concept / Approach:
High cohesion and low coupling are widely accepted goals. Measuring cohesion and coupling gives actionable insight: high cohesion suggests focused, understandable modules; low coupling reduces ripple effects of change and eases testing. Combining both yields a balanced picture of design quality.
Step-by-Step Solution:
Identify recognized metrics: cohesion and coupling.Determine their roles: cohesion internal focus; coupling external dependencies.Conclude that both together assess modular design quality most effectively.Verification / Alternative check:
Textbook guidelines (e.g., structured design, object-oriented design) consistently emphasize maximizing cohesion and minimizing coupling as core design principles, validating the combined use of these measures.
Why Other Options Are Wrong:
- Module strength only: Incomplete—ignores coupling effects.
- Module coupling only: Incomplete—ignores internal focus of cohesion.
- Static analysis only: A method, not a design quality metric.
- None of the above: Incorrect because the pair of metrics is correct.
Common Pitfalls:
Optimizing one metric at the expense of the other; for example, extremely high cohesion with hidden tight coupling through global state. Also, assuming cohesion can be perfectly quantified—often qualitative judgment is required.
Final Answer:
Both module strength and module coupling