High cohesion within modules
coupling
The degree of interdependence between software modules.
advantages
- A change in one module does not have a ripple effects requiring a change in another.
- Promotes code re-use and ease of testing by reducing dependencies.
cohesion
The degree to which elements inside a module belong together.
- If methods of a class are similar in many aspects, the class has high cohesion.
advantages
- Improved code readability
- Improved code reusability
- Complexity is manageable
examples
Bad: The only relationship between the parts is that they have been grouped together.
- Ex: A “utilities” class
Good: Parts are grouped because they operate on the same data.
- Ex: A class that manipulates XML.
Robustness—the ability of a system to cope with bad input and/or errors during execution. Redundancy—one way to support a system’s robustness.