Module

The term “module” can be used for different partitions:

  1. statements
  2. functions
  3. objects
  4. object groups (“modules” in a colloquial sense), affecting architecture
  5. libraries (aka Swift modules)
  6. applications

What’s the boundary of a module?

Why does it do X but not Y?

Good justification may result in high cohesion; however, unjustifiable boundaries will result in low cohesion, being merely accidental.
See the example of High Cohesion and Low Coupling with Presenter, View, and View Model, and the counter-example of low cohesion through ‘incidental’ grouping based on superficialities.

A module in each level should be a black box: “Black Box” in software modeling.