//
Coupling and Cohesion are the two most important metrics for evaluating the quality of a software design. Good design strives for low coupling and high cohesion.
Coupling measures the degree of interdependence between software modules. Low coupling means modules are independent; changes in one module have minimal impact on others.
Cohesion measures how closely related the responsibilities within a single module are. High cohesion means a module does one thing well.
Utils class with formatDate(), parseJSON(), and calculateTax().| Metric | Goal | Example |
|---|---|---|
| Coupling | LOW | Classes communicate through interfaces, not concrete implementations |
| Cohesion | HIGH | Each class has a single, focused responsibility (SRP) |
A class with high cohesion and low coupling is easy to understand in isolation, easy to test, easy to reuse, and easy to modify without breaking other parts of the system.