---
title: "Short note: cohesion and coupling"
subject: "Software Engineering"
chapter: 3
key: "semester_5/software_engineering:cohesion-coupling"
source: https://www.bctengineer.com/q/semester_5/software_engineering/cohesion-coupling
site: BCT Engineering
---

# Short note: cohesion and coupling

Software Engineering · Chapter 3: Architectural design

- Asked in: 2068 Baishakh (old course), 5 marks
- Video: [Cohesion and Coupling in Software Engineering](https://www.youtube.com/watch?v=NweTzHYBgYU) — Gate Smashers
- Answer checked by Claude Sonnet 5.5 on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/software_engineering/cohesion-coupling
- Whole chapter: https://www.bctengineer.com/md/semester_5/software_engineering/chapter-3

## Question

Write a short note on cohesion and coupling.

## Short answer

Cohesion measures how closely elements inside one module belong together; coupling measures interdependence between modules. Good design has high cohesion and low coupling. Best cohesion is functional, best coupling is data; high cohesion usually leads to low coupling.

## Answer

**Cohesion** and **coupling** are the two main measures of module quality in software design. A good design has **high cohesion and low coupling**, which makes modules easy to understand, test, change and reuse.

#### Cohesion
Cohesion is the degree to which the elements **inside one module** belong together and work toward a single task. Types, from worst (lowest) to best (highest):

1. **Coincidental** – unrelated tasks grouped by chance (e.g. a "utilities" module).
2. **Logical** – tasks of the same category, selected by a flag (e.g. all input routines).
3. **Temporal** – tasks done at the same time (e.g. initialisation).
4. **Procedural** – tasks that follow a fixed order of execution.
5. **Communicational** – tasks that operate on the same data.
6. **Sequential** – output of one task is input to the next.
7. **Functional** – every element contributes to exactly one function (e.g. `computeTax()`); the ideal.

#### Coupling
Coupling is the degree of **interdependence between modules**. Types, from worst (tightest) to best (loosest):

1. **Content** – one module changes or jumps into the internals of another.
2. **Common** – modules share global data.
3. **External** – modules share an external format, device or protocol.
4. **Control** – one module passes a flag that controls the other's logic.
5. **Stamp** – a whole data structure is passed when only part is needed.
6. **Data** – only the needed simple data items are passed as parameters; the ideal.

| Cohesion | Coupling |
|---|---|
| Inside a single module | Between modules |
| Should be high | Should be low |
| Best type: functional | Best type: data |
| Shows module's focus | Shows module's independence |

High cohesion usually leads to low coupling: when each module does one job, it needs little from other modules.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Cohesion measures the interdependence of elements:
   A. Between modules
   B. Between users and the system
   C. Inside one module
   D. Between hardware devices
   Answer: C. Cohesion is inside a single module; coupling is between modules. (Key point: Definitions)

2. Which cohesion type is the ideal?
   A. Coincidental
   B. Logical
   C. Temporal
   D. Functional
   Answer: D. Functional cohesion, where every element contributes to exactly one function, is the best. (Key point: Best cohesion)

3. Which describes stamp coupling?
   A. A whole data structure is passed when only part is needed
   B. Modules share global data
   C. One module jumps into another's internals
   D. Only needed simple items are passed
   Answer: A. Stamp coupling passes a whole structure although only part is used. (Key point: Stamp coupling)

4. Which coupling is the tightest (worst)?
   A. Data
   B. Content
   C. Control
   D. Common
   Answer: B. Content coupling, where one module changes or jumps into another's internals, is the worst. (Key point: Worst coupling)

## Related in other subjects

- [Cohesion and coupling in software](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Acohesion-coupling) — Instrumentation II, chapter 9
